Java程序辅导

C C++ Java Python Processing编程在线培训 程序编写 软件开发 视频讲解

客服在线QQ:2653320439 微信:ittutor Email:itutor@qq.com
wx: cjtutor
QQ: 2653320439
UCSD CSE 15L
 
Java Debugging and
the Scientific Method
Week 10 (Lab 9)
November 30, 2011
Quiz today!
1.Keep your quiz sheet upside down.
2.At the announcement, turn it over and start.
3.Write on the front and, if necessary, on the back.
4.You have seven minutes.  
5.Turn the quiz over again, at the announcement.
Today’s quiz question
Fill in the correct word in each of the blanks below. These sentences are adapted from 
Wikipedia.
“______ testing seeks to reveal errors in existing functionality after changes have been 
made to a system. The intent of regression testing is to ensure that a change, such as a 
bugfix, did not cause old ______ to reappear. Regression tests can be broadly categorized 
as functional tests or ______ tests. Functional tests exercise the complete program with 
various inputs. ______ tests exercise individual functions, subroutines, or object methods. 
It is often considered good coding practice that when a bug is located and fixed, a test that 
exposes the bug is recorded and  ______ after subsequent changes to the program. 
Regression testing has traditionally been performed by a software quality assurance team 
after the development team has completed work. However, defects found at this stage are 
______ costly to fix.”
Unit tests
This week, you need to write your own unit tests.
Unit test: An automated test case for a single method. 
Tetris
Directions are in today’s handout
JUnit 4 framework in Eclipse
A test is a special method, one annotated with @Test.
Each test has an assertion; the test fails if the assertion is false. 
Green tests pass, red tests do not terminate, blue tests fail.
JUnit runs methods annotated @Before prior to all tests. To 
run a single test, right click on it and select Debug.
Use the features of Eclipse
Do not use print commands.
Instead, use break points and watch expressions.
Let’s go!
The code for this week’s lab is on the class website at 
http://cseweb.ucsd.edu/~elkan/15L
Please move to the labs now: B230, B40, B250 and B260. 
Pick a new partner and get started.  Do not work with the same 
partner twice.