Pocket some basic knowledge about testing for developers (Part 1)

Tram Ho

1. Introduction

When doing major school assignments developing an application, most students usually focus on writing the code to make the application run without paying attention to testing the application. This does not seem to be a problem as most of the school assignments are just small applications where errors can completely be found quickly. However, the projects in practice are often quite large. Creating an error can be very difficult to detect and fix, which can have serious consequences. Therefore, application testing becomes important to be able to find errors and fix errors as quickly as possible.

While developers know that testing plays an important role in software development, many developers do not care about testing (usually new developers), they think that it is the job of the Developer to create The function and the testing job are those of the Tester From a certain point of view, this is true, but as a Developer we often have to write Unit Tests, the knowledge and thinking of a Tester is also necessary for a Developer:

  • Thinking Tester helps us cover the situations that can cause errors to the system, thereby devising appropriate solutions.
  • Thinking Tester will also make communication between Developer and Tester easier when it is often necessary to work together.
  • Know how to divide the system into parts for easy testing.
  • Tester-thinking developers will consider the code they write carefully, so the code written will have fewer bugs, help improve the quality of software, save software development time.

In this article, I would like to present, introduce some basic concepts about testing that Developer should know.

2. The basic concepts of testing

1. White box testing and black box testing (White box / Black box)

  • White box testing: A test where we know the source code. Testing of this type can help us know if our code is running properly or not.
  • Black box test: A black box test that means users don’t know how the system works based on input and output to see if the system works properly.

2. Manual Test and Automation Test

  • Manual Test: A manual test by running the program and checking whether the obtained result is correct or not.
  • Automation Test: Using the code to check automatically, the code will automatically run the program to create inputs and compare the program’s output to the results and produce reports.

3. The test level

  1. Unit Test: Unit tests often written by developers to test code of components independently, performed on the smallest components in the program such as functions, classes, etc. up the components of the program and prove the exact parts required by the functions.
  2. Integration test: Testing components in a system to see how they communicate with each other to detect communication errors between components. There are 4 types of tests in Integration tests:
    • Structure test: like the white box testing with emphasis on the structural components of the program.
    • Functional testing: Like a black box test that focuses on the function of a program regardless of how the program works.
    • Performance test: Check the operation of the system.
    • Check system load capacity (stress): Check the limits of the system.
  3. System Test: Test the entire system to see if the system is working properly or not, meet the requirements given. System tests are usually performed by an independent testing team with the project development team.
  4. Acceptance test: The objective of this test is to evaluate the system’s compliance with business requirements and verify whether it is acceptable for delivery. Acceptance tests are often performed by customers.

3. Conclusion

In part 1, I introduced some of the basic concepts of testing. In part 2, I will introduce TDD (Test Driven Development) and BDD (Behavior Driven Development) hoping that everyone will support.

Share the news now

Source : Viblo