37 votes
Accepted

With good unit tests, do I also need acceptance tests?

Is it still needed to write acceptance tests that target verifying those business rules implementation? Yes, it is absolutely necessary. Your unit tests cover the business rules in isolation. ...
user avatar
  • 30.8k
33 votes

Is it good practice to write unit tests when features are changed frequently?

Yes that is the ideal situation for Unit tests To look at a different situation - if you are writing software that will not be changed in the future then perhaps you could consider skipping the tests. ...
user avatar
26 votes
Accepted

Should I unit test for null values even if it can never happen?

Yes, it is. Because the unit tests are not only for the current version of the code. They are especially for all future versions and if somebody changes the code and does not know what s/he did, the ...
user avatar
  • 1,624
15 votes

How do testers perform unit testing?

The short answer - Usually they don't. Developers write unit tests and ideally run them every time the software builds. The longer version - Unit tests are intended to test a single unit of code. ...
user avatar
  • 30.8k
15 votes

Is it good practice to write unit tests when features are changed frequently?

Yes, the idea of writing the right form of unit-tests is that it keeps the cost of change low. If you make a lot of changes they are here to help you go faster. The biggest mistake most people make is ...
user avatar
13 votes
Accepted

Test strategy to bring automated tests from UI to lower(API/Unit) layers?

A key strategy for me is to convince the business of what needs to be tested where, otherwise... they'll end up directing testing everything through the UI... So the two key main points I am making ...
user avatar
11 votes
Accepted

Implementing the Test Pyramid as QA

I am definitely using the test pyramid as one of my 'guidance' tools. I frequently combine it with the 4 Agile Testing quadrants in talks and presentations.        &...
user avatar
11 votes

Should QA test features that are already covered by developers (according to what they say) with unit tests?

There is no concept of overlapping testcases in different test levels, Both are completely isolated Just because API or Component works fine you cannot guarantee the whole system or integrated system ...
user avatar
  • 10.8k
10 votes
Accepted

Should integration tests test business logic?

No if it can be done in Unit tests The answer however is not a yes / no as this is not really a binary choice. When possible use Unit tests. If you are testing 'based on this information from this ...
user avatar
8 votes
Accepted

Will writing unit tests block developers from coding?

The TDD cycle is more a development cycle for a developer, to quote James Shore, The Art of Agile, Test-Driven Development chapter: Programmers new to TDD are often surprised at how small each ...
user avatar
7 votes
Accepted

Where do Fitnesse fits between unittests and API testing?

Full disclosure: we rely heavily on FitNesse, run many hours worth of FitNesse tests daily in our CI buildbot daily, and I personally wrote both FitNesse tests (using Fit wiki format in browser) and ...
user avatar
7 votes
Accepted

Pros and cons of python unit testing packages

Nose is no longer maintained: Nose has been in maintenance mode for the past several years and will likely cease without a new person/team to take over maintainership. New projects should ...
user avatar
  • 11.4k
7 votes

Test strategy to bring automated tests from UI to lower(API/Unit) layers?

Estimate working load, how many test cases are there to be migrated from UI tests? Estimate how much time you can spare in each sprint and discuss with your team leader and your fellow members ...
user avatar
  • 9,660
7 votes
Accepted

Random code changes - terminology and tools

Mutation testing (or mutation analysis or program mutation) is used to design new software tests and evaluate the quality of existing software tests. Mutation testing involves modifying a program ...
user avatar
7 votes
Accepted

Is unit testing related only to software development?

Yes, Unit-testing is only software related. No testing the implementation of a dashboard cannot be considered Unit-testing. Unit-tests typically test relatively small programming functions. A ...
user avatar
6 votes
Accepted

How do you test your unit-tests for false negatives?

There are two (actually both are very similar) techniques in order to reveal the tests which tend to be "false/positive" ones – Error Seeding and Mutation Testing. The both principles are based on ...
user avatar
6 votes

How can testers motivate developers to write unit tests?

Unit test are far superior in detecting root cause of the bug, compared to e2e tests. Maybe I am lucky, but our developers are religious about adding unit tests - because they experienced that it ...
user avatar
6 votes
Accepted

How can testers motivate developers to write unit tests?

It starts with explaining developers to take their discipline serious. They should follow the programmers oath. I will produce, with each release, a quick, sure, and repeatable proof that every ...
user avatar
6 votes
Accepted

Naming a positive "happy path" test case

If there is one thing I like about good test names is that when it fails on a build-server I can understand what is broken just from reading its name. If the name of the test does not describe what it ...
user avatar
6 votes

Is it good practice to write unit tests when features are changed frequently?

Yes. Because those bits that do not change still need testing. The rest that does change, well, that's just a part of the process, you simply need to change things once in a while. Writing tests makes ...
user avatar
  • 4,328
6 votes

Should I push my changes for testing and then work on unit tests?

Oh, that's a long one. Let's take two points of view: Pragmatic POV: they insist on faster delivery Saying that TDD would decrease delivery speed is not necessarily true. If you search for studies ...
user avatar
  • 9,949
5 votes

With good unit tests, do I also need acceptance tests?

Yes you should have scenarios which verify the unit tested business rules. Some reasons: good unit tests mock and stub the datastore. Acceptance tests make sure it is configured and works correctly....
user avatar
5 votes
Accepted

Try Assert Exceptions not failing test in python unittest or better way to loop through failures

I think you just need to re-raise the assertion error after printing out log messages: try: self.assertEqual(len(self.verificationErrors), 0) # no errors except AssertionError as e: for ...
user avatar
  • 11.4k
5 votes

How to setup a Headless-Browser Unit-Test for Angular application?`

Angular has some great tooling for running tests, namely Karma and Protractor. By default (at least when using Angular CLI) they run using Chrome. So when you execute the tests from command-line, it ...
user avatar
5 votes

How to handle “fake” unit tests that don’t really test anything?

I believe that the strongest instrument for filtering such a-low-quality tests is a code review. You can power-up your code review with mutational testing techniques which will help you to detect the ...
user avatar
  • 11.4k
5 votes
Accepted

How unit testing helps QA testers?

On my mind comes at least three thing: If unit test are developed by developer with focus on testing simple functionality: then you as tester (this highly depends on experience of developer with for ...
user avatar
  • 323
5 votes

Best practice guide for documenting unit tests?

Carefully name tests reflecting requirement in the form of input data & expected result. I have been in similar situation but for integration UI tests, where it really helped us when we started ...
user avatar
5 votes
Accepted

How to choose between shell script vs compiled, from testing perspective

Here are some cons for shell scripting that would make me take my decision towards "compiled" case: Shell scripts are more dependent on the execution context. So this impacts the ...
user avatar
  • 11.4k
5 votes
Accepted

How to create input data for unit tests for an API client?

You're definitely on the right track here. I would start by collecting actual requests and responses generated by the live system, then anonymize as needed. These would be the seeds of your tests, ...
user avatar
  • 30.8k
5 votes
Accepted

Code coverage for Integration tests

Some relevant guidelines: The goal is confidence, not coverage. If you have good coverage with well-written unit tests then a tiny number of high-level tests can be enough to have confidence that the ...
user avatar
  • 468

Only top scored, non community-wiki answers of a minimum length are eligible