expensive • M a nu a l testing does not sc a le • Regression issues a ppe a r frequently • Tests provide con f idence during ref a ctoring • Softw a re engineering relies on a utom a tion
implement a tion • Tests a ct a s "execut a ble requirements" • Focus on beh a vior a nd correctness • Encour a ges modul a r a nd m a int a in a ble design
a rd J a v a testing fr a mework • Tests a re written a s J a v a methods • Assertions verify expected beh a vior • Tests should be isol a ted a nd repe a t a ble @Test • Set up your objects • Execute behavior • Assert // assertEquals(expected, // actual) // assertTrue(condition) // assertThrows(exception, code)
Applic a tion code • src/test/j a v a → Test code • pom.xml → Dependencies a nd build con f igur a tion • mvn test → Execute a utom a ted tests • Maven automatically discovers test classes • JUnit tests execute during the build process • Builds fail if tests fail
Winter 2026 Copyright. These slides can only be used as study material for the class CSC307 at Cal Poly. They cannot be distributed or used for another purpose.