Skip to content

mkutz/untangle-your-spaghetti-test-code

Repository files navigation

Untangle Your Spaghetti Test Code

Build Sonar Quality Gate Sonar Coverage

Setup

  1. Login to GitHub or create an account.
  2. If you don't have a local JDK 21 installation + an IDE: create a new workspace at Gitpod. This usually takes a little while, just be patient.
  3. Open ApplicationTest from the file tree on the left. You should be able to execute the containing tests by clicking the green play button in the gutter.

Structure

Structure

Objectives

Feel free to use the Cheat Sheet for inspiration.

  1. Have a look at the ApplicationTest.

    Brainstorm: Which problems do you see?
    • Do you understand what's being tested?
    • Is there a proper arrange, act, assert structure in the test cases?
    • Are the names of test cases and variables consistent?
      Does it help to understand implications of failures?
      Does it help to find the corresponding code?
    • Do you understand how the test works technically?
    • Do you see where the test data is coming from?
    • Which code duplications do you find?
      How would you reduce them?
    • Are the Test Code Quality Criteria applied?
  2. Ensemble: Let's untangle it!

  3. Have a look at the test at UnicornServiceTest, UnicornControllerTest and UnicornTest.

    Brainstorm: Which problems do you see?
    • Which layer of the testing pyramid is this test on?
      Is the layer appropriate for the test cases? Can we move tests here?

References

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •