Software Testing Software testing 1 V model Software










![What can we do in in a test unit ² Annotations ² [Test. Class] What can we do in in a test unit ² Annotations ² [Test. Class]](https://slidetodoc.com/presentation_image_h2/bf9030a16c1a2198fa95fd7fbfb1d59f/image-11.jpg)

- Slides: 12
Software Testing Software testing 1
V model Software testing 2
Program testing goals ² To demonstrate to the developer and the customer that the software meets its requirements. => leads to validation testing ² To discover situations in which the behavior of the software is incorrect, undesirable or does not conform to its specification. => leads to defect testing Software testing 3
Verification vs validation ² Verification: (testing) "Are we building the product right”. § The software should conform to its specification. ² Validation: (checking) "Are we building the right product”. § The software should do what the user really requires. Software testing 4
V model Software testing 5
Different levels of testing related to the V-model ² Verify the concepts and requirements e. g. Are the domain model right? The use cases? (the users) ² Verify the design e. g. design class diagrams and design sequence diagrams (Reviews, Technical walkthrough by the project team) ² Component Validation e. g. unit test and test cases (implementer) ² System and integration validation e. g. system/integration test ² Operation Validation e. g. acceptance test Software testing 6
Black box testing ² The system code is ‘unknown’ -> a black box ² Look only at the methods signatures ² Testing all kind of possible input and output ² In C# create a Unit Test Software testing 7
Equivalence partitioning Software testing 8
Equivalence partitions Software testing 9
Unit test in c# ² Console Programs § Create a test unit project, § Add reference to the project, § Remember to have the class to be tested public. (in resharper set cursor at the class – right click choose generate unit test) § Make a test method for each test case ² App Programs § Create a unit test app (universal windows), § Add reference to the project, § Remember to have the class to be tested public. (in resharper set cursor at the class – right click choose generate unit test) § Make a test method for each test case Software testing 10
What can we do in in a test unit ² Annotations ² [Test. Class] : set up the test ² [Test. Method ] : This is a test method to be run ² [Test. Initialize] : Run this before each test method ² Testing validation ² Assert. Are. Equal( expected, actual) ² Assert. Is. True(actual) Software testing 11
Special for exception ² Console programs § Make try – catch : NB! The catch is ok = green § Try{ Call method; Assert. Fail(); Catch{ //Ok } § Alternative make an annotation [Expected. Exception typeof (xxx. Exception) ] ² App programs § Assert. Throws. Exception<xxx. Exception>( () => call method) Software testing 12