Top Banner
Testing on Steriods EECS 4315 www.cse.yorku.ca/course/4315/ www.cse.yorku.ca/course/4315/ EECS 4315 1 / 31
57

EECS 4315 ¦ · Unit Testing Aunit testis designed to test a single unit of code, for example, a method. Such a test should be automated as much as possible; ideally,

Jul 07, 2020

Download

Documents

dariahiddleston
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: EECS 4315 ¦ · Unit Testing Aunit testis designed to test a single unit of code, for example, a method. Such a test should be automated as much as possible; ideally,

Testing on SteriodsEECS 4315

www.cse.yorku.ca/course/4315/

www.cse.yorku.ca/course/4315/ EECS 4315 1 / 31

Page 2: EECS 4315 ¦ · Unit Testing Aunit testis designed to test a single unit of code, for example, a method. Such a test should be automated as much as possible; ideally,

Unit Testing

A unit test is designed to test a single unit of code, for example,a method.

Such a test should be automated as much as possible; ideally,it should require no human interaction in order to run, shouldassess its own results, and notify the programmer only when itfails.

A class that contains unit tests is known as a test case.

The code to be tested is known as the unit under test.

www.cse.yorku.ca/course/4315/ EECS 4315 2 / 31

Page 3: EECS 4315 ¦ · Unit Testing Aunit testis designed to test a single unit of code, for example, a method. Such a test should be automated as much as possible; ideally,

JUnit

JUnit is a Java unit testing framework written by Kent Beck andErich Gamma.

JUnit is available at www.junit.org.

www.cse.yorku.ca/course/4315/ EECS 4315 3 / 31

Page 4: EECS 4315 ¦ · Unit Testing Aunit testis designed to test a single unit of code, for example, a method. Such a test should be automated as much as possible; ideally,

Java Annotations

Annotations provide data about code that is not part of the codeitself. Therefore, it is also called metadata.

In its simplest form, an annotation looks like

@Deprecated

(The annotation type Deprecated is part of java.lang and,therefore, need not be imported.)

An annotation can include elements and their values:

@Test(timeout=1000)

(The annotation type Test is part of org.junit and,therefore, needs to be imported.)

www.cse.yorku.ca/course/4315/ EECS 4315 4 / 31

Page 5: EECS 4315 ¦ · Unit Testing Aunit testis designed to test a single unit of code, for example, a method. Such a test should be automated as much as possible; ideally,

A Test Case

import org.junit.Assert;import org.junit.Test;

public class ...{

@Testpublic void ...(){

...}

@Testpublic void ...(){

...}

}www.cse.yorku.ca/course/4315/ EECS 4315 5 / 31

Page 6: EECS 4315 ¦ · Unit Testing Aunit testis designed to test a single unit of code, for example, a method. Such a test should be automated as much as possible; ideally,

Names of Test Methods

It is good practice to use descriptive names for the testmethods. This makes tests more readable when they arelooked at later.

www.cse.yorku.ca/course/4315/ EECS 4315 6 / 31

Page 7: EECS 4315 ¦ · Unit Testing Aunit testis designed to test a single unit of code, for example, a method. Such a test should be automated as much as possible; ideally,

Assertions in Test Methods

Each test method should contain (at least) one assertion: aninvocation of a method of the Assert class of the org.unitpackage.

Do not confuse these assertions with Java’s assert statement.

www.cse.yorku.ca/course/4315/ EECS 4315 7 / 31

Page 8: EECS 4315 ¦ · Unit Testing Aunit testis designed to test a single unit of code, for example, a method. Such a test should be automated as much as possible; ideally,

Body of Unit Test Method

1 Create some objects.2 Invoke methods on them.3 Check the results using a method of the Assert class.

www.cse.yorku.ca/course/4315/ EECS 4315 8 / 31

Page 9: EECS 4315 ¦ · Unit Testing Aunit testis designed to test a single unit of code, for example, a method. Such a test should be automated as much as possible; ideally,

Test Case

For each attribute, method and constructor (from simplest tomost complex)

1 Study its API.2 Create unit tests.

www.cse.yorku.ca/course/4315/ EECS 4315 9 / 31

Page 10: EECS 4315 ¦ · Unit Testing Aunit testis designed to test a single unit of code, for example, a method. Such a test should be automated as much as possible; ideally,

Test the attribute MIN_VALUE

QuestionWhat can we test about the attribute MIN_VALUE?

AnswerIts value.

www.cse.yorku.ca/course/4315/ EECS 4315 10 / 31

Page 11: EECS 4315 ¦ · Unit Testing Aunit testis designed to test a single unit of code, for example, a method. Such a test should be automated as much as possible; ideally,

Test the attribute MIN_VALUE

QuestionWhat can we test about the attribute MIN_VALUE?

AnswerIts value.

www.cse.yorku.ca/course/4315/ EECS 4315 10 / 31

Page 12: EECS 4315 ¦ · Unit Testing Aunit testis designed to test a single unit of code, for example, a method. Such a test should be automated as much as possible; ideally,

Test the attribute MIN_VALUE

QuestionCan the test

@Testpublic void testMinValue(){Assert.assertEquals(new Byte(Byte.MIN_VALUE),

new Byte((byte) -128));}

be simplified?

www.cse.yorku.ca/course/4315/ EECS 4315 11 / 31

Page 13: EECS 4315 ¦ · Unit Testing Aunit testis designed to test a single unit of code, for example, a method. Such a test should be automated as much as possible; ideally,

Test the attribute MIN_VALUE

QuestionCan the test

@Testpublic void testMinValue(){Assert.assertEquals("-128",

Byte.MIN_VALUE + "");}

be simplified?

www.cse.yorku.ca/course/4315/ EECS 4315 12 / 31

Page 14: EECS 4315 ¦ · Unit Testing Aunit testis designed to test a single unit of code, for example, a method. Such a test should be automated as much as possible; ideally,

Test the constructor

QuestionWhat can we test about the constructor?

AnswerThat the object is not null.

www.cse.yorku.ca/course/4315/ EECS 4315 13 / 31

Page 15: EECS 4315 ¦ · Unit Testing Aunit testis designed to test a single unit of code, for example, a method. Such a test should be automated as much as possible; ideally,

Test the constructor

QuestionWhat can we test about the constructor?

AnswerThat the object is not null.

www.cse.yorku.ca/course/4315/ EECS 4315 13 / 31

Page 16: EECS 4315 ¦ · Unit Testing Aunit testis designed to test a single unit of code, for example, a method. Such a test should be automated as much as possible; ideally,

Test the constructor

QuestionWhat does the following test check?

@Testpublic void testConstructor(){Byte b = new Byte(0);Assert.assertTrue(b.getClass() == Byte.class);

}

AnswerThe constructor returns an object of type Byte.

www.cse.yorku.ca/course/4315/ EECS 4315 14 / 31

Page 17: EECS 4315 ¦ · Unit Testing Aunit testis designed to test a single unit of code, for example, a method. Such a test should be automated as much as possible; ideally,

Test the constructor

QuestionWhat does the following test check?

@Testpublic void testConstructor(){Byte b = new Byte(0);Assert.assertTrue(b.getClass() == Byte.class);

}

AnswerThe constructor returns an object of type Byte.

www.cse.yorku.ca/course/4315/ EECS 4315 14 / 31

Page 18: EECS 4315 ¦ · Unit Testing Aunit testis designed to test a single unit of code, for example, a method. Such a test should be automated as much as possible; ideally,

Test the constructor

QuestionDoes the constructor conform to the API if it returns an instanceof a subclass of the class Byte?

AnswerYes?

www.cse.yorku.ca/course/4315/ EECS 4315 15 / 31

Page 19: EECS 4315 ¦ · Unit Testing Aunit testis designed to test a single unit of code, for example, a method. Such a test should be automated as much as possible; ideally,

Test the constructor

QuestionDoes the constructor conform to the API if it returns an instanceof a subclass of the class Byte?

AnswerYes?

www.cse.yorku.ca/course/4315/ EECS 4315 15 / 31

Page 20: EECS 4315 ¦ · Unit Testing Aunit testis designed to test a single unit of code, for example, a method. Such a test should be automated as much as possible; ideally,

Test the constructor

QuestionWhat does the following test check?

@Test(expected=NumberFormatException.class)public void testConstructor(){new Byte(new java.lang.Byte("asfgsdgf"));

}

AnswerThe constructor of the class java.lang, not the constructor ofthe class quiz.Byte.

www.cse.yorku.ca/course/4315/ EECS 4315 16 / 31

Page 21: EECS 4315 ¦ · Unit Testing Aunit testis designed to test a single unit of code, for example, a method. Such a test should be automated as much as possible; ideally,

Test the constructor

QuestionWhat does the following test check?

@Test(expected=NumberFormatException.class)public void testConstructor(){new Byte(new java.lang.Byte("asfgsdgf"));

}

AnswerThe constructor of the class java.lang, not the constructor ofthe class quiz.Byte.

www.cse.yorku.ca/course/4315/ EECS 4315 16 / 31

Page 22: EECS 4315 ¦ · Unit Testing Aunit testis designed to test a single unit of code, for example, a method. Such a test should be automated as much as possible; ideally,

Test the constructor

QuestionWhat does the following test check?

@Test(expected = NumberFormatException.class)public void testConstructor(){new Byte(Byte.MIN_VALUE - 1 + "");

}

AnswerNothing. It fails to compile.

www.cse.yorku.ca/course/4315/ EECS 4315 17 / 31

Page 23: EECS 4315 ¦ · Unit Testing Aunit testis designed to test a single unit of code, for example, a method. Such a test should be automated as much as possible; ideally,

Test the constructor

QuestionWhat does the following test check?

@Test(expected = NumberFormatException.class)public void testConstructor(){new Byte(Byte.MIN_VALUE - 1 + "");

}

AnswerNothing. It fails to compile.

www.cse.yorku.ca/course/4315/ EECS 4315 17 / 31

Page 24: EECS 4315 ¦ · Unit Testing Aunit testis designed to test a single unit of code, for example, a method. Such a test should be automated as much as possible; ideally,

Test the equals method

QuestionWhat can we test about the equals method?

AnswerWhether two Byte objects are the same.Whether a Byte object is equal to itself.Whether a Byte object is equal to null.Whether a Byte object is equal to an object of anothertype.

www.cse.yorku.ca/course/4315/ EECS 4315 18 / 31

Page 25: EECS 4315 ¦ · Unit Testing Aunit testis designed to test a single unit of code, for example, a method. Such a test should be automated as much as possible; ideally,

Test the equals method

QuestionWhat can we test about the equals method?

AnswerWhether two Byte objects are the same.Whether a Byte object is equal to itself.Whether a Byte object is equal to null.Whether a Byte object is equal to an object of anothertype.

www.cse.yorku.ca/course/4315/ EECS 4315 18 / 31

Page 26: EECS 4315 ¦ · Unit Testing Aunit testis designed to test a single unit of code, for example, a method. Such a test should be automated as much as possible; ideally,

Test the equals method

QuestionFor which Byte object(s) do we check equality to itself.

AnswerAll (there are only 256 different ones).

www.cse.yorku.ca/course/4315/ EECS 4315 19 / 31

Page 27: EECS 4315 ¦ · Unit Testing Aunit testis designed to test a single unit of code, for example, a method. Such a test should be automated as much as possible; ideally,

Test the equals method

QuestionFor which Byte object(s) do we check equality to itself.

AnswerAll (there are only 256 different ones).

www.cse.yorku.ca/course/4315/ EECS 4315 19 / 31

Page 28: EECS 4315 ¦ · Unit Testing Aunit testis designed to test a single unit of code, for example, a method. Such a test should be automated as much as possible; ideally,

Test the equals method

QuestionIs the following test correct?

@Testpublic void testEquals(){

for (int a = Byte.MIN_VALUE; a <= Byte.MAX_VALUE; a++){

for (int b = Byte.MIN_VALUE; b <= Byte.MAX_VALUE; b++){

Assert.assertEquals(new Byte((byte) a),new Byte((byte) b));

}}

}

www.cse.yorku.ca/course/4315/ EECS 4315 20 / 31

Page 29: EECS 4315 ¦ · Unit Testing Aunit testis designed to test a single unit of code, for example, a method. Such a test should be automated as much as possible; ideally,

Test the hashCode method

QuestionWhat can we test about the hashCode method?

AnswerThe value it returns.

www.cse.yorku.ca/course/4315/ EECS 4315 21 / 31

Page 30: EECS 4315 ¦ · Unit Testing Aunit testis designed to test a single unit of code, for example, a method. Such a test should be automated as much as possible; ideally,

Test the hashCode method

QuestionWhat can we test about the hashCode method?

AnswerThe value it returns.

www.cse.yorku.ca/course/4315/ EECS 4315 21 / 31

Page 31: EECS 4315 ¦ · Unit Testing Aunit testis designed to test a single unit of code, for example, a method. Such a test should be automated as much as possible; ideally,

Test the hashCode method

QuestionWhat does the following test check?

@Testpublic void testHashCode(){Assert.assertEquals(new Byte((byte) 1).hashCode(),

new Byte((byte) 1).hashCode());}

AnswerNot much (API: The hash code is the value of this object,represented as an int.)

www.cse.yorku.ca/course/4315/ EECS 4315 22 / 31

Page 32: EECS 4315 ¦ · Unit Testing Aunit testis designed to test a single unit of code, for example, a method. Such a test should be automated as much as possible; ideally,

Test the hashCode method

QuestionWhat does the following test check?

@Testpublic void testHashCode(){Assert.assertEquals(new Byte((byte) 1).hashCode(),

new Byte((byte) 1).hashCode());}

AnswerNot much (API: The hash code is the value of this object,represented as an int.)

www.cse.yorku.ca/course/4315/ EECS 4315 22 / 31

Page 33: EECS 4315 ¦ · Unit Testing Aunit testis designed to test a single unit of code, for example, a method. Such a test should be automated as much as possible; ideally,

Test the isEven method

QuestionWhat can we test about the isEven method?

AnswerThe value it returns.

www.cse.yorku.ca/course/4315/ EECS 4315 23 / 31

Page 34: EECS 4315 ¦ · Unit Testing Aunit testis designed to test a single unit of code, for example, a method. Such a test should be automated as much as possible; ideally,

Test the isEven method

QuestionWhat can we test about the isEven method?

AnswerThe value it returns.

www.cse.yorku.ca/course/4315/ EECS 4315 23 / 31

Page 35: EECS 4315 ¦ · Unit Testing Aunit testis designed to test a single unit of code, for example, a method. Such a test should be automated as much as possible; ideally,

Test the toString method

QuestionWhat can we test about the toString method?

AnswerThe value it returns.

www.cse.yorku.ca/course/4315/ EECS 4315 24 / 31

Page 36: EECS 4315 ¦ · Unit Testing Aunit testis designed to test a single unit of code, for example, a method. Such a test should be automated as much as possible; ideally,

Test the toString method

QuestionWhat can we test about the toString method?

AnswerThe value it returns.

www.cse.yorku.ca/course/4315/ EECS 4315 24 / 31

Page 37: EECS 4315 ¦ · Unit Testing Aunit testis designed to test a single unit of code, for example, a method. Such a test should be automated as much as possible; ideally,

Test the Byte Class

QuestionIf we run the JUnit test case ByteTest and all tests pass, canwe conclude that the class Byte correctly implements the API?

AnswerNo.

QuestionWhy not?

AnswerRun the JUnit test case ByteTest several times.

www.cse.yorku.ca/course/4315/ EECS 4315 25 / 31

Page 38: EECS 4315 ¦ · Unit Testing Aunit testis designed to test a single unit of code, for example, a method. Such a test should be automated as much as possible; ideally,

Test the Byte Class

QuestionIf we run the JUnit test case ByteTest and all tests pass, canwe conclude that the class Byte correctly implements the API?

AnswerNo.

QuestionWhy not?

AnswerRun the JUnit test case ByteTest several times.

www.cse.yorku.ca/course/4315/ EECS 4315 25 / 31

Page 39: EECS 4315 ¦ · Unit Testing Aunit testis designed to test a single unit of code, for example, a method. Such a test should be automated as much as possible; ideally,

Test the Byte Class

QuestionIf we run the JUnit test case ByteTest and all tests pass, canwe conclude that the class Byte correctly implements the API?

AnswerNo.

QuestionWhy not?

AnswerRun the JUnit test case ByteTest several times.

www.cse.yorku.ca/course/4315/ EECS 4315 25 / 31

Page 40: EECS 4315 ¦ · Unit Testing Aunit testis designed to test a single unit of code, for example, a method. Such a test should be automated as much as possible; ideally,

Test the Byte Class

QuestionIf we run the JUnit test case ByteTest and all tests pass, canwe conclude that the class Byte correctly implements the API?

AnswerNo.

QuestionWhy not?

AnswerRun the JUnit test case ByteTest several times.

www.cse.yorku.ca/course/4315/ EECS 4315 25 / 31

Page 41: EECS 4315 ¦ · Unit Testing Aunit testis designed to test a single unit of code, for example, a method. Such a test should be automated as much as possible; ideally,

Test the Byte Class

QuestionHow is it possible that the JUnit test case ByteTest passes alltests pass in some runs and fails the method testMinValuein other runs?

AnswerLet’s have a look at the code of MIN_VALUE.

AnswerBecause the code of MIN_VALUE uses randomization.

www.cse.yorku.ca/course/4315/ EECS 4315 26 / 31

Page 42: EECS 4315 ¦ · Unit Testing Aunit testis designed to test a single unit of code, for example, a method. Such a test should be automated as much as possible; ideally,

Test the Byte Class

QuestionHow is it possible that the JUnit test case ByteTest passes alltests pass in some runs and fails the method testMinValuein other runs?

AnswerLet’s have a look at the code of MIN_VALUE.

AnswerBecause the code of MIN_VALUE uses randomization.

www.cse.yorku.ca/course/4315/ EECS 4315 26 / 31

Page 43: EECS 4315 ¦ · Unit Testing Aunit testis designed to test a single unit of code, for example, a method. Such a test should be automated as much as possible; ideally,

Test the Byte Class

QuestionHow is it possible that the JUnit test case ByteTest passes alltests pass in some runs and fails the method testMinValuein other runs?

AnswerLet’s have a look at the code of MIN_VALUE.

AnswerBecause the code of MIN_VALUE uses randomization.

www.cse.yorku.ca/course/4315/ EECS 4315 26 / 31

Page 44: EECS 4315 ¦ · Unit Testing Aunit testis designed to test a single unit of code, for example, a method. Such a test should be automated as much as possible; ideally,

Randomization

QuestionWhy are we interested in randomization in our code?

AnswerThe source code of most computer and video games containssome sort of randomization. This provides games with theability to surprise players, which is a key factor to theirlong-term appeal.

Katie Salen and Eric Zimmerman. Rules of Play: Game DesignFundamentals. The MIT Press. 2004.

www.cse.yorku.ca/course/4315/ EECS 4315 27 / 31

Page 45: EECS 4315 ¦ · Unit Testing Aunit testis designed to test a single unit of code, for example, a method. Such a test should be automated as much as possible; ideally,

Randomization

QuestionWhy are we interested in randomization in our code?

AnswerThe source code of most computer and video games containssome sort of randomization. This provides games with theability to surprise players, which is a key factor to theirlong-term appeal.

Katie Salen and Eric Zimmerman. Rules of Play: Game DesignFundamentals. The MIT Press. 2004.

www.cse.yorku.ca/course/4315/ EECS 4315 27 / 31

Page 46: EECS 4315 ¦ · Unit Testing Aunit testis designed to test a single unit of code, for example, a method. Such a test should be automated as much as possible; ideally,

Randomization

QuestionWhy are we interested in randomization in our code?

AnswerRandomization may reduce the expected running time ormemory usage.

QuestionWhich algorithms exploit randomization this way?

AnswerRandomized quicksort.Skiplist.. . .

www.cse.yorku.ca/course/4315/ EECS 4315 28 / 31

Page 47: EECS 4315 ¦ · Unit Testing Aunit testis designed to test a single unit of code, for example, a method. Such a test should be automated as much as possible; ideally,

Randomization

QuestionWhy are we interested in randomization in our code?

AnswerRandomization may reduce the expected running time ormemory usage.

QuestionWhich algorithms exploit randomization this way?

AnswerRandomized quicksort.Skiplist.. . .

www.cse.yorku.ca/course/4315/ EECS 4315 28 / 31

Page 48: EECS 4315 ¦ · Unit Testing Aunit testis designed to test a single unit of code, for example, a method. Such a test should be automated as much as possible; ideally,

Randomization

QuestionWhy are we interested in randomization in our code?

AnswerRandomization may reduce the expected running time ormemory usage.

QuestionWhich algorithms exploit randomization this way?

AnswerRandomized quicksort.Skiplist.. . .

www.cse.yorku.ca/course/4315/ EECS 4315 28 / 31

Page 49: EECS 4315 ¦ · Unit Testing Aunit testis designed to test a single unit of code, for example, a method. Such a test should be automated as much as possible; ideally,

Randomization

QuestionWhy are we interested in randomization in our code?

AnswerRandomization may reduce the expected running time ormemory usage.

QuestionWhich algorithms exploit randomization this way?

AnswerRandomized quicksort.Skiplist.. . .

www.cse.yorku.ca/course/4315/ EECS 4315 28 / 31

Page 50: EECS 4315 ¦ · Unit Testing Aunit testis designed to test a single unit of code, for example, a method. Such a test should be automated as much as possible; ideally,

Randomization

QuestionWhy are we interested in randomization in our code?

AnswerRandomization may allow us to solve problems.

QuestionFor which problems is randomization exploited this way?

AnswerConsensus problem (in an asynchronous distributedsystem in which processes may fail).. . .

www.cse.yorku.ca/course/4315/ EECS 4315 29 / 31

Page 51: EECS 4315 ¦ · Unit Testing Aunit testis designed to test a single unit of code, for example, a method. Such a test should be automated as much as possible; ideally,

Randomization

QuestionWhy are we interested in randomization in our code?

AnswerRandomization may allow us to solve problems.

QuestionFor which problems is randomization exploited this way?

AnswerConsensus problem (in an asynchronous distributedsystem in which processes may fail).. . .

www.cse.yorku.ca/course/4315/ EECS 4315 29 / 31

Page 52: EECS 4315 ¦ · Unit Testing Aunit testis designed to test a single unit of code, for example, a method. Such a test should be automated as much as possible; ideally,

Randomization

QuestionWhy are we interested in randomization in our code?

AnswerRandomization may allow us to solve problems.

QuestionFor which problems is randomization exploited this way?

AnswerConsensus problem (in an asynchronous distributedsystem in which processes may fail).. . .

www.cse.yorku.ca/course/4315/ EECS 4315 29 / 31

Page 53: EECS 4315 ¦ · Unit Testing Aunit testis designed to test a single unit of code, for example, a method. Such a test should be automated as much as possible; ideally,

Randomization

QuestionWhy are we interested in randomization in our code?

AnswerRandomization may allow us to solve problems.

QuestionFor which problems is randomization exploited this way?

AnswerConsensus problem (in an asynchronous distributedsystem in which processes may fail).. . .

www.cse.yorku.ca/course/4315/ EECS 4315 29 / 31

Page 54: EECS 4315 ¦ · Unit Testing Aunit testis designed to test a single unit of code, for example, a method. Such a test should be automated as much as possible; ideally,

Nondeterminism

Nondeterministic code is code that, even for the same input,can exhibit different behaviors on different runs, as opposed todeterministic code.

Randomization gives rise to nondeterminism.

QuestionBesides randomization, are there other programming conceptthat give rise to nondeterminism?

AnswerConcurrency.

www.cse.yorku.ca/course/4315/ EECS 4315 30 / 31

Page 55: EECS 4315 ¦ · Unit Testing Aunit testis designed to test a single unit of code, for example, a method. Such a test should be automated as much as possible; ideally,

Nondeterminism

Nondeterministic code is code that, even for the same input,can exhibit different behaviors on different runs, as opposed todeterministic code.

Randomization gives rise to nondeterminism.

QuestionBesides randomization, are there other programming conceptthat give rise to nondeterminism?

AnswerConcurrency.

www.cse.yorku.ca/course/4315/ EECS 4315 30 / 31

Page 56: EECS 4315 ¦ · Unit Testing Aunit testis designed to test a single unit of code, for example, a method. Such a test should be automated as much as possible; ideally,

Nondeterminism

Nondeterministic code is code that, even for the same input,can exhibit different behaviors on different runs, as opposed todeterministic code.

Randomization gives rise to nondeterminism.

QuestionBesides randomization, are there other programming conceptthat give rise to nondeterminism?

AnswerConcurrency.

www.cse.yorku.ca/course/4315/ EECS 4315 30 / 31

Page 57: EECS 4315 ¦ · Unit Testing Aunit testis designed to test a single unit of code, for example, a method. Such a test should be automated as much as possible; ideally,

Quiz 1

When: Monday January 16 during the labTopic: testing

www.cse.yorku.ca/course/4315/ EECS 4315 31 / 31