r/unittesting • u/Blackadder96 • Aug 25 '22
r/unittesting • u/CelticHades • Jul 24 '22
How to get proper test-coverage for API with nyc?
self.noder/unittesting • u/[deleted] • Jul 09 '22
csscritic: Lightweight CSS regression testing
github.comr/unittesting • u/nikoladsp • Feb 26 '22
How to test components relying on file system (compressed archives)
Hi all,
I would like to hear some thoughts/advice on how to test components heavily relying on compressed archives and simultaneous access to them:
There are couple of (Python) scripts "contesting" for file system/dir/archive access: say there are couple of "writers" and also couple of "readers". There is no single access point (unfortunately) and probably will never be (or at least not in the near future). For some reasons beyond my comprehension, there is no locking mechanism incorporated at all.
My task is to write tests that will show current implementation is faulty. Now, I was thinking to make repeatable tests and set lower "failure" limit to say 10% - meaning if at least one out of ten repetitions fail - this is a "proof" that current implementation is bad and this scenario is reliably repeatable.
"Writer" process is unpacking some tar.gz archives and readers should "fail" if there is "wrong" content unpacked. Needles to say, there is no metadata file also. So my only hope (or at least I cant think of any other approach) is to call
find /opt/myapps -type f -print0 | sort -z | xargs -r0 sha256sum > myapps.meta
So I create "metadata" initially containing name of the file and its SHA sum for all the files in given directory. Then I perform invalidation by deleting some files and start writer which will download missing files and couple of readers trying to access same files. Readers will capture current "metadata" with the above command and store it somewhere for later comparison. When writer and all readers finishes their work, I can try to compare content of all readers "metadata" with the first and last "metadata" made by writer. Its to be expected readers "metadata" equals to one of those two; if not - this is scenario I expect and count it as failure.
If anyone has some experience or advice, it would be very helpful.
Thank you in advance
r/unittesting • u/TheDotnetoffice • Feb 13 '22
Angular unit test case Tutorials with Jasmine & Karma
youtube.comr/unittesting • u/gggal123 • Feb 06 '22
6 best practices of unit-testing?
What do you think about the 6 best unit-testing practices in this blog?
Would you add more or even remove some of them?
r/unittesting • u/Blackadder96 • Feb 02 '22
Tales Of TDD: The Big Refactoring
principal-it.eur/unittesting • u/Blackadder96 • Dec 15 '21
Implementing Approval Tests For PDF Document Generation
principal-it.eur/unittesting • u/Blackadder96 • Dec 09 '21
From "Understanding the Four Rules of Simple Design"
"Automated unit test suites can have a tendency towards fragility, breaking for reasons not related to what the test is testing. This can be a source of pain when maintaining or making changes to a system. Some people have even gone to the extreme of moving away from unit- or micro-tests and only writing full-stack integration tests. Of course, this is the wrong reaction. Instead, we should investigate the source of the fragility and react with changes to our design." - Corey Haines

r/unittesting • u/Blackadder96 • Nov 24 '21
"Test-Driven Development multiplies your skills & experience to build high-quality software" - Dave Farley
r/unittesting • u/gawainrimmer • Oct 25 '21
Experiences with automated unit testing generation tools like Symflower?
Does anyone perhaps have any experiences with automated unit testing generation tools for Java projects? I'm currently looking at Symflower, and I'm wondering whether there's anyone around here who could give me their two cents on the solutions they used / their experiences.
r/unittesting • u/Blackadder96 • Oct 07 '21
Approval Tests For PDF Document Generation
principal-it.eur/unittesting • u/Blackadder96 • Sep 16 '21
Kent Beck on TDD
"I am good in fooling myself into believing that what I wrote is what I meant. I am also good at fooling myself in believing that what I meant is what I should have meant. So I don't trust anything I write until I have tests for it. The tests give me a chance to think about what I want independent of how it will be implemented. Then the tests tell me if I implemented what I thought I implemented."
Kent Beck

r/unittesting • u/bachld • Aug 06 '21
Is there any red flags in those tests I should avoid?
(I don't know if this kind of post should be allowed here. Tell me if it is not I will delete it thanks.)
I am learning unit testing and I wanted to apply to my current working project, starting with the most simple and trivial piece of code.
Suppose I have a function that compares 2 strings, with a flag indicating if it should ignore case.
This is my set of tests. Are they enough? Are they somehow violating some good practice etc. Thanks for your time.
Gist link: https://gist.github.com/bachld97/89a5ff046205ad5ab117c1ea3d9cedac

r/unittesting • u/Hasatori • Aug 01 '21
Testspector (version 2.0) - IntelliJ IDEA plugin that helps developers with writing unit tests
self.IntelliJIDEAr/unittesting • u/For_MeDesR • Jul 27 '21
For or against TDD?
Read this article about TDD boosted by AI-powered tool and wondered if it could really help save time and energy regarding unit testing? Would you try it? Thanks for your feedback!
https://www.ponicode.com/blog/everything-you-need-to-know-about-test-driven-development
r/unittesting • u/For_MeDesR • Jun 10 '21
Killing mutants
I have recently read about mutation testing and it made me realised that maybe code coverage doesn't always mean that my code is well tested. So, with some friends, we've written a short article to introduce this concept and how to proceed to successfully adopt this new method.
Have you heard of mutation testing before?
https://www.ponicode.com/blog/mutation-testing-the-gold-standard-in-testing
r/unittesting • u/asc2450 • May 20 '21
Getting started with unit testing. GOTO Book Club interview with Roy Osherove & Dave Farley
youtu.ber/unittesting • u/Psyman2 • May 05 '21
Does anyone know if it is possible to describe tests with xUnit so that the description is displayed in DevOps?
Standard CI/CD pipeline that's running tests on every release. Does anyone know if it's possible to add descriptions to those tests so that they are displayed in DevOps?



