projects

02software testingSpring 2025

Company Management

A web app for running a company’s staffing: workers, the qualifications they hold, and the projects that need them. Built test-first by a team of five for a software testing course at Colorado State University, where the tests mattered as much as the app.

  • role Software Engineer
  • team Five students
  • context Sprint-based Development, Semester Long Project
  • stack Java, React, JUnit, Mockito, JaCoCo, PIT, EvoSuite
demo clip goes here

The Project

A web app that lets a company manage its people and its work: a React client on top of a Java server with a REST API. The rules live in the server, and they’re what made it interesting to test:

  • Create qualifications, workers who hold them, and projects that require them.
  • Assign workers to projects, as long as they cover a qualification the project is still missing and won’t be overloaded (small, medium and big projects count for 1, 2 and 3 points of a 12-point limit).
  • Start a project once every qualification it needs is covered, then finish it. Each project lists the qualifications it’s still missing, and one that loses a key worker mid-way gets suspended.

Testing Like It Matters

The app was the vehicle; the course was about testing it properly. Each sprint added a new way of finding bugs:

  • Designing unit tests with input space partitioning and base choice coverage tables, so every test had a reason to exist (119 hand-written JUnit tests by the end).
  • Measuring line and branch coverage with JaCoCo, then mutation testing with PIT to check whether the tests actually catch changes to the code.
  • Generating extra test suites automatically with EvoSuite and Randoop, and comparing them with our own.
  • Running static analysis with SpotBugs and PMD, and fixing what they found.
  • Writing use cases and end-to-end test cases for the finished web app.
  • Running coverage and mutation tests on every push with GitHub Actions.

My Contributions

  • Implemented core pieces of the Company model (its constructor and equality, creating qualifications and projects, and listing them), each with tests written alongside.
  • Fixed a bug where checking a project’s missing qualifications quietly changed the project’s own list of required qualifications.
  • Wrote much of the input space partitioning report: the partition and base choice tables for the company and qualification methods.
  • Added the REST endpoints for listing qualifications and workers, and for looking one up by name, with tests that call the running API.
  • Set up EvoSuite, generated its test suites, and documented the results.
  • Built the “create qualification” form and restyled the worker, project and qualification pages near the end of the semester.

Key Takeaways

Code coverage was the number we watched at first, and it looked good. Mutation testing changed that: PIT makes small changes to the code and checks whether any test fails. Even after we added tests, about one in six of those changes to the Company class went unnoticed, in code our tests already ran. Coverage tells you code ran; mutation testing tells you whether a test would notice it breaking.

Planning tests on paper first, with input space partitioning, made them better and faster to write. Each test came from a table of input categories rather than whatever edge case came to mind, so gaps were easy to spot. When we skipped that step early on, we ended up going back to write the tables for tests we’d already finished.

Automated test generators are useful but not a replacement. EvoSuite and Randoop produced whole test suites in minutes, but they mostly pin down what the code currently does, right or wrong, and they’re hard to read. They worked best as a second opinion next to tests written with intent.

Small mistakes compound. Getters that handed out the object’s own internal sets, instead of copies, let other code change a project or company behind its back. Static analysis flagged it, and it was the same kind of bug I’d fixed by hand in the missing-qualifications check.