The Second Week of Project 1: Unit Testing

As the second week of Project 1 rolled in, our task to build the unit tests we had each chosen began. To recap, me and seven other classmates were grouped into a team to practice unit tests, with a focus on working via GitHub. This project was designed…


This content originally appeared on DEV Community and was authored by CyberFriend

As the second week of Project 1 rolled in, our task to build the unit tests we had each chosen began. To recap, me and seven other classmates were grouped into a team to practice unit tests, with a focus on working via GitHub. This project was designed to throw us into the reality of software engineering. Working in teams isn’t always as smooth as it should be, and remote work especially demands flawless communication, which not everyone is used to.

For this project, I took on the role of team lead. Honestly, I did everything I could to ensure our final tests were 100% successful (and maybe even went beyond my assigned role to make that happen!).

Below, you can see the methods I selected for my testing:

Image description

In Part B of the project, I worked with IntelliJ using the Gradle tool. Our team agreed to maintain a consistent commenting style across all tests so our code would look cohesive as one unified project. For example, here’s part of my test for HSetTest:
`@DisplayName("Yurii - HSetTest")
class HSetTest {
HSet hSet;

@BeforeEach
@DisplayName("Setting up the test environment")
void setUp() { 
    hSet = new HSet<>(); 
}

@AfterEach
@DisplayName("Tearing down the test environment")
void tearDown() { 
    hSet.clear(); 
}

@Test
@DisplayName("HSet size should return 0 after creation")
void size() {
    assertEquals(0, hSet.size(), "The size of a newly created HSet should be 0");
}

}

https://i0.wp.com/blog.codeanalogies.com/wp-content/uploads/2019/05/codeanim2.gif?resize=640%2C360&ssl=1

Since I had never done Unit Testing before, this project was not exactly a walk in the park. However, with some effort, I managed to complete all my tests and even helped other team members who ran into issues. One of the key lessons from this project was learning to work with GitHub’s pull requests. The whole process of reviewing and merging files was new to me but quite interesting to navigate as part of a team.

I believe one of the most important aspects of this project was setting rules for the main branch. Since many of us were new to working with pull requests, some initial mistakes could have seriously harmed the entire project. Luckily, we reviewed each pull request carefully, which saved us from potential disaster.

After missing our internal deadline (we are still on the project time tho), we finally managed to run all the tests successfully and achieved a 100% pass rate.

Image description


This content originally appeared on DEV Community and was authored by CyberFriend


Print Share Comment Cite Upload Translate Updates
APA

CyberFriend | Sciencx (2024-10-08T19:06:45+00:00) The Second Week of Project 1: Unit Testing. Retrieved from https://www.scien.cx/2024/10/08/the-second-week-of-project-1-unit-testing/

MLA
" » The Second Week of Project 1: Unit Testing." CyberFriend | Sciencx - Tuesday October 8, 2024, https://www.scien.cx/2024/10/08/the-second-week-of-project-1-unit-testing/
HARVARD
CyberFriend | Sciencx Tuesday October 8, 2024 » The Second Week of Project 1: Unit Testing., viewed ,<https://www.scien.cx/2024/10/08/the-second-week-of-project-1-unit-testing/>
VANCOUVER
CyberFriend | Sciencx - » The Second Week of Project 1: Unit Testing. [Internet]. [Accessed ]. Available from: https://www.scien.cx/2024/10/08/the-second-week-of-project-1-unit-testing/
CHICAGO
" » The Second Week of Project 1: Unit Testing." CyberFriend | Sciencx - Accessed . https://www.scien.cx/2024/10/08/the-second-week-of-project-1-unit-testing/
IEEE
" » The Second Week of Project 1: Unit Testing." CyberFriend | Sciencx [Online]. Available: https://www.scien.cx/2024/10/08/the-second-week-of-project-1-unit-testing/. [Accessed: ]
rf:citation
» The Second Week of Project 1: Unit Testing | CyberFriend | Sciencx | https://www.scien.cx/2024/10/08/the-second-week-of-project-1-unit-testing/ |

Please log in to upload a file.




There are no updates yet.
Click the Upload button above to add an update.

You must be logged in to translate posts. Please log in or register.