Browsed by
Tag: CodingChaos

Tip #2: To make your tests more specific and focus only on the class you are testing, mock everything else.

Tip #2: To make your tests more specific and focus only on the class you are testing, mock everything else.

It is always observed that changes in one class cause other class’s tests to fail. This happens often because many other classes change when we change one class, leading to many other tests changing / breaking. It is always best to mock all other classes. That way, other classes are not actually used in the test, and you can ensure that your tests do not break! This also ensures that the only coverage we get is from the test written…

Read More Read More

Tip 1: Always commit as many unrelated features and bug fixes as possible into a single commit.

Tip 1: Always commit as many unrelated features and bug fixes as possible into a single commit.

First, this will make your commit message a cryptic mishmash, which no sane person will understand! Second, when someone needs to cherry-pick something from one branch onto another, they’ll be unable to do so cleanly. If you are linking your commits with JIRA, this is even more awesome because now the unrelated JIRA stories are also linked together by this commit! And if your team uses JIRA or commit messages to write release notes, oh well, they are in for…

Read More Read More