Professional Documents
Culture Documents
SWE 434 Software Testing and Validation
SWE 434 Software Testing and Validation
Software Testing 1
SWE 434
Software Testing and Validation
Lecture’s Agenda
Java Program
1.package lab1;
Program Editor
Output Console
Software Testing Research Group (Practical Labs)
Software Testing 8
Software Testing
Myers, 1979
Software Testing Research Group (Practical Labs)
Software Testing 9
Unit Testing
• The process of validating a piece of code (function or
method) with required input and expected output.
Input Output
Unit
Software Testing Research Group (Practical Labs)
Software Testing 10
1. Test Case
“A test case is a small unit of code that tests a specific method”
• INPUT: Actions send to System Under Test (SUT).
• OUTPUT: Responses expected from SUT.
• VALIDATION: To Check the Test, was successful or not?
Test Case
@Test
public void testDiv() { Actions send to system under test (SUT).
int actual=MyMath.div(6, 2); Responses expected from SUT.
int expected=3;
Assert.assertEquals(expected, actual); Determine whether a test was successful or
} not?