Download presentation
Presentation is loading. Please wait.
Published byKenneth Hutchinson Modified over 9 years ago
1
CS4272 Hardware-Software Co-design Assignment 2 School of Computing National University of Singapore Guo Liang
2
Testing Testing – an essential step of development Organized as test cases for different components Selectively executed – Test cases must be independent We are going to identify dependent test cases and discuss the solution
3
Tools Involved Use JSlice to find dependence between test cases of JMeter JMeter test cases based on JUnit Execute JUnit for execution of JMeter test cases
4
JSlice Dynamic slicing tool for Java Another Java virtual machine – Use it to execute Java program and to slice Compatible with Java 1.4 Available on Linux
5
Access Server: modelchk.ddns.comp.nus.edu.sg ID/password: sent Connect using SSH
6
Self Access Copy the folder /usr/local/slicing on the server Put under the same path in your own box Tested on Fedora Core 3 and 4 only
7
JUnit A unit testing framework Test case template class provided Application test cases extending template class
8
JMeter Java based application Functional and performance evaluation Test cases provided by developer for unit testing
9
Overview JSlice JMeter test cases JUnit Call test case methods using reflection The Java Program Execute Trace Slice Slicing Result
10
Slicing Criterion Method criterion – (class, method) – All statements executed between method entry and exit Specified in file: – Number_of_criteria – Class_name_1 method_name_1 – Class_name_2 method_name_2 – …
11
Slicing Result A set of statements – The criterion control/data dependent on In result file: – Class name 1 – Line number 1 – Class name 2 – Line number 2 – …
12
Execute JSlice Navigate to JMeter home folder Execute – sh runtest.sh criteria sliceresult The slice result is saved in sliceresult
13
JMeter Test Cases 8 test cases shown in JMeterTestSuite.java Each test case may have several single tests All methods within the test case class are considered as part of the test case Report dependence between test cases, not between single tests You may modify JMeter and its test cases
14
A Sample Test Case public class HelloWorld extends TestCase { public void setUp() { … } public void testAddition() { … } public void testMultiplication() { … } public void tearDown() { … } }
15
Test Case Dependence A B – Test case B is control / data dependent on test case A A common case – A global variable v defined during A while used during B Execution sequence
16
Two Types of A B Real test case dependence – Removing A, B’s behavior is different – The variable is in the application Other test case dependence – Removing A does not affect B – The variable is in Java library
17
The Assignment Find all test case dependence Identify real dependence State the reason and solution
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.