mubbashir / untangle-your-spaghetti-test-code

Repository from Github https://github.commubbashir/untangle-your-spaghetti-test-codeRepository from Github https://github.commubbashir/untangle-your-spaghetti-test-code

Untangle Your Spaghetti Test Code

Build Sonar Quality Gate Sonar Coverage

Open in Gitpod

Agenda

When What Objective
14:45 Welcome: what we do, setup, code
15:55 Together: review the code base
15:00 Brainstorming: about problems Have a look at the UnicornServiceApplicationTest.
15:15 Untangle the code Fix some tangles in the UnicornServiceApplicationTest
15:30 Coffee break
16:00 Untangle the code continued
16:35 Retro
16:45 The end

Setup

  1. Login to GitHub or create an account: github.com/join.
  2. Follow this link and follow the instructions. When the New Workspace page appears, click Continue. (Creating the workspace takes a little while, just be patient)
  3. Open UnicornServiceApplicationTests.java from the file tree on the left and wait for the Java installation to finish. (A box will appear on the bottom right, saying Opening Java Projects, you can click on check details to follow the installation progress.) After the installation is done, you can right click into the code, and select Run test at Cursor (to run a single test) or Run Tests in Current File (to run all tests).

Objectives

  1. Have a look at the UnicornServiceApplicationTest.

    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?

About

License:Apache License 2.0


Languages

Language:Java 97.2%Language:Shell 2.8%