0% found this document useful (0 votes)
73 views11 pages

SWE 434 Software Testing and Validation

The document discusses software testing concepts including: 1) An introduction to software testing, Java programming, the Eclipse IDE, and the JUnit testing framework. 2) Details on setting up the Java Runtime Environment and Eclipse IDE to write and run Java programs and JUnit tests. 3) An overview of unit testing, test cases, and how a test execution system like JUnit can run tests and validate results.

Uploaded by

talal
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
73 views11 pages

SWE 434 Software Testing and Validation

The document discusses software testing concepts including: 1) An introduction to software testing, Java programming, the Eclipse IDE, and the JUnit testing framework. 2) Details on setting up the Java Runtime Environment and Eclipse IDE to write and run Java programs and JUnit tests. 3) An overview of unit testing, test cases, and how a test execution system like JUnit can run tests and validate results.

Uploaded by

talal
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 11

Software Testing Research Group (Practical Labs)

Software Testing 1

SWE 434
Software Testing and Validation

Lecture slides are available on following website through your university


student login
https://lms.ksu.edu.sa/
Software Testing Research Group (Practical Labs)
Software Testing 2

Lecture’s Agenda

• Brief discussion about programming (Java)

• Introduction to IDE (Eclipse)

• Introduction to Software Testing Framework (JUnit)


Software Testing Research Group (Practical Labs)
Software Testing 3

Java Program
1.package lab1;

2.public class MyMath


3.{
4. public static void main( String[] args )
5. {
6. int result = MyMath.div( 6, 2 );
7. System.out.println( result );
8. }

9. public static int div( int a, int b )


10. {
11. return a / b;
12. }
13.}
Software Testing Research Group (Practical Labs)
Software Testing 4

Integrated Development Environment (IDE)


• Eclipse downloads are available on
http://www.eclipse.org/downloads/packages/eclipse-classic-372/indigosr2
Software Testing Research Group (Practical Labs)
Software Testing 5

Java Runtime Environment(JRE 7)


• If JRE is not installed in system, then download it from
• http://www.oracle.com/technetwork/java/javase/downloads/jre7-downloads-1880261.html

• Download the relevant installation package, and


• Do the JRE 7 installation!
Software Testing Research Group (Practical Labs)
Software Testing 6

Integrated Development Environment (IDE)


• Eclipse

• It should be in following folder eclipse-SDK-3.7.2-win32\

• Please open the eclipse.exe


Software Testing Research Group (Practical Labs)
Software Testing 7

Integrated Development Environment (IDE)


Tool-Box

Program Editor

Project Explorer Class Outline

Output Console
Software Testing Research Group (Practical Labs)
Software Testing 8

Software Testing

The process of executing a program with the intent of finding errors.

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

Test Case and Test Execution System

• What we need to do for automated testing?

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?

2. Test Execution System


• Mechanism to read test scripts, and connect test cases to System
Under Test, for example JUNIT.
• Keeps track of test results.
Software Testing Research Group (Practical Labs)
Software Testing 11

Software Testing Process


System Under Test (SUT) Test Execution System (JUNIT)

public class MyMath


{
public static void main( String[] args )
{}
UNIT
public int div( int a, int b )
{}
}

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?

You might also like