User Tools

Site Tools


concepts:unit-test
  • Bookmark "Unit Test" at del.icio.us
  • Bookmark "Unit Test" at Digg
  • Bookmark "Unit Test" at Furl
  • Bookmark "Unit Test" at Reddit
  • Bookmark "Unit Test" at Ask
  • Bookmark "Unit Test" at Google
  • Bookmark "Unit Test" at Netscape
  • Bookmark "Unit Test" at StumbleUpon
  • Bookmark "Unit Test" at Technorati
  • Bookmark "Unit Test" at Live Bookmarks
  • Bookmark "Unit Test" at Yahoo! Myweb
  • Bookmark "Unit Test" at Facebook
  • Bookmark "Unit Test" at Newsvine
  • Bookmark "Unit Test" at Yahoo! Bookmarks
  • Bookmark "Unit Test" at Twitter
  • Bookmark "Unit Test" at myAOL
  • Bookmark "Unit Test" at Slashdot
  • Bookmark "Unit Test" at Mister Wong

Unit Test

What is a test?

A test is a very important thing in the software development. There are different reasons to make tests, for example a test can measure the quality of a new software. It discovers errors as early as possible and this can reduce the costs. Additionally it checks the functionality of the software. This mean, that it makes only what it should make and doesn’t make something unexpected. (1)

Unit Test

The first scheduled test for a completed software component is the unit test. It only tests a new component separated from the complete software. So other errors in the software can be excluded. Another big advantage of the separation is, that the effects, which are not from the component, have no influence on the result of the test. When the test shows, that there are some errors in the component, it is very easy to find the reason for this error, because the component is smaller and less complex than the whole software. Discovered errors for example can be calculation errors. In this case the calculation algorithm is wrong, so the result of the calculation is also wrong. Another example for a discovered error is, that the component has a very long execution time. The reason for that error could be a not good matching algorithm for the use case. (2)

Strategies

There are two different strategies to make a unit test: Black-Box Test and White-Box Test. But it is necessary to write test drivers for the components no matter which strategy is chosen. The test drivers should start the test component with the test case and register the reaction of the component. (2)

Black-Box Test

The tester doesn’t know how the component is internal implemented. He uses the specification of the component to make test cases. The tester has only the external interfaces to communicate with the component. (2)

White-Box Test

The tester knows how the component is internal implemented. So the tester uses the source code to make test cases. He can utilize debugger to observe the internal status and change the source code while the test is running. (2)

Agile methods and Unit Tests

Agile methods have the goal to use the Unit Test as often as possible for the quality assurance. This goal can only be reached, when the procedure of testing is fully automated. This mean, that the test is a program, which can be started by only one click on a button. The program is often written in the same language as the component, but it must not be the same language. (3)

Conclusion

The most important goal of the Unit Test is to take the smallest piece of the new software, isolate it and check if it works how it should work. After that every component can be integrated into modules. Then the functionality of the interfaces between the components can be checked. The Unit Test discovers a lot of errors, which can be fixed very early and so the costs for the software development can be reduced. (4)


(1) cf. https://msdn.microsoft.com/en-us/library/aa292191%28v=vs.71%29.aspx 30.04.2016

(2) cf. http://www.software-kompetenz.de/servlet/is/10127/?print=true 30.04.2016

(3) cf. https://www.it-agile.de/wissen/praktiken/agiles-testen/unit-tests/ 30.04.2016

(4) cf. https://msdn.microsoft.com/en-us/library/aa292197%28v=vs.71%29.aspx 30.04.2016

  • Bookmark "Unit Test" at del.icio.us
  • Bookmark "Unit Test" at Digg
  • Bookmark "Unit Test" at Furl
  • Bookmark "Unit Test" at Reddit
  • Bookmark "Unit Test" at Ask
  • Bookmark "Unit Test" at Google
  • Bookmark "Unit Test" at Netscape
  • Bookmark "Unit Test" at StumbleUpon
  • Bookmark "Unit Test" at Technorati
  • Bookmark "Unit Test" at Live Bookmarks
  • Bookmark "Unit Test" at Yahoo! Myweb
  • Bookmark "Unit Test" at Facebook
  • Bookmark "Unit Test" at Newsvine
  • Bookmark "Unit Test" at Yahoo! Bookmarks
  • Bookmark "Unit Test" at Twitter
  • Bookmark "Unit Test" at myAOL
  • Bookmark "Unit Test" at Slashdot
  • Bookmark "Unit Test" at Mister Wong
concepts/unit-test.txt · Last modified: 2016/04/30 17:36 by Wolf