I've just released #cmocka version 1.1.8:
* Set CMOCKA_LIBRARIES in package config for backwards compatibility
* Improve c_strreplace implementation
* Sanitize XML strings
* Update check for uintptr_t
* Require cmake >= 3.10
I've just released #cmocka version 1.1.8:
* Set CMOCKA_LIBRARIES in package config for backwards compatibility
* Improve c_strreplace implementation
* Sanitize XML strings
* Update check for uintptr_t
* Require cmake >= 3.10
@nedbat I'm used to JUnit's assertEquals(expected, butgot) and it prints
Expected <<<x>>> but got <<<b>>>
Which is slightly better when you have long chunks of output (HTML and XML), butgot will be at the end instead of buried a page or two up. For short answers it doesn't matter.
#unitTesting #extremeProgramming #soExtreme!
falsify
A few days ago, Edsko de Vries of Well-Typed published an in-depth article on property-based software testing, with a focus on the concept of “shrinking.”
In brief, property-based testing is sort-of like fuzz testing but for algorithms and protocols. Like fuzz testing, random test cases are procedurally generated, but unlike fuzz testing, the test cases are carefully designed to verify whether a software implementation of an algorithm satisfies a specific property of that algorithm, such as:
n*log(n)
number of iterations for input dataset of size n
““the sequence of log messages is guaranteed to obey this rules of this particular finite-state automata: (connect | fail) -> (send X | fail) -> (receive Y | receive Z | fail) -> success .”
Shrinking is the process of simplifying a failed test case. If you have found some input that makes your function return a value when it should have thrown an exception, or produce a result that does not satisfy some predicate, then that input is a “counterexample” to your assertion about the properties of that function. And you may want to be able to “shrink” that counterexample input to see if you can cause the function to behave incorrectly again but with a simpler input. The “QuickCheck“ library provides a variety of useful tools to let you define property tests with shrinking.
Defining unit tests with such incredible rigor takes quite a lot of time and effort, so you would probably do not want to use property-based testing for your ordinary, every-day software engineering. If you are, for example, being scrutinized by the US Department of Government of Efficiency, you would likely be fired if you were to take so much time to write such high-quality software with such a strong guarantee of correctness.
But if you are, for example, designing a communication protocol that will be used in critical infrastructure for the next 10 or 20 years and you want to make sure the reference implementation of your protocol is without contradictions, or if you are implementing an algorithm where the mathematical properties of the algorithm fall within some proven parameters (e.g. computational complexity), property-based testing can give you a much higher degree of confidence in the correctness of your algorithm or protocol specification.
3 Reasons .NET Developers Still Struggle with Unit Testing (And How to Fix It).
https://www.typemock.com/why-dotnet-unit-testing-feels-hard/
MSTest 3.8: Top 10 features to supercharge your .NET tests!
https://devblogs.microsoft.com/dotnet/mstest-3-8-highlights/?hide_banner=true
#Mockito : to use any() or not to use any(), that's the question! Don't be shy and elaborate!
Fedi friends, I have a physical #programming book about #UnitTesting to give away. This one really surprised me and changed my approach to writing tests. I read it at a time when I was on a big project with a big test suite and it helped me understand why making changes to the code were so painful. I know what to look out for now.
Vladimir Khorikov - Unit Testing
I can have it delivered to a German address free of charge, just let me know.
Boosts appreciated.
My personal Dopamine kick: all tests pass.
(I know it seems silly, but it really makes a difference for my motivation if the output is colored white (like boring ordinary text) or green (like a distinct success message).
How to generate unit tests with GitHub Copilot: Tips and examples.
https://buff.ly/49pSCXd
#github #githubcopilot #ai #aiassistant #unittesting #python #typescript #claudeai #tdd
New Amazon Q Developer agent capabilities include generating documentation, code reviews, and unit tests.
https://buff.ly/3BjOZ8k
#ai #aws #amazonq #aiagent #cloud #codereviews #unittesting #productivity #docs
Quick heads up: I just deprecated @small-tech/tape-with-promises (for adding promise support to Tape 4.x).
https://www.npmjs.com/package/@small-tech/tape-with-promises
Tape version 5.x supports promises so my little module is no longer necessary unless you’re stuck on v4.x.
What’s tape? A neat little JavaScript unit testing framework I like:
https://github.com/tape-testing/tape
Already use tape? Does your test runner need more monkeys and bananas? Try my tap-monkey module:
https://codeberg.org/small-tech/tap-monkey#readme
Ready to master unit testing in .NET? Learn how to use #xUnit, #NSubstitute, and #AutoFixture in this step-by-step guide with HangfireDemoApi. From mocking to background tasks, we’ve got you covered!
Read more https://wp.me/p29SK-Wy
#UnitTesting #DotNet #developers
Supercharge your testing experience with MSTest.Analyzers.
#dotnet #visualstudio #csharp #unittesting #testing
https://devblogs.microsoft.com/dotnet/supercharge-your-testing-experience-with-ms-test-analyzers/
Dive into native Windows development with new WinUI workload and template improvements.
#visualstudio #winui #windowsdev #dotnet #csharp #xaml #windowsappsdk #unittesting
https://devblogs.microsoft.com/visualstudio/dive-into-native-windows-development-with-new-winui-workload-and-template-improvements/
dotCover Command Line Tools for Automation Testing Code Coverage.
https://blog.jetbrains.com/dotnet/2024/06/20/dotcover-command-line-tools-for-automation-testing-code-coverage/
#dotnet #dotcover #jetbrains #codecoverage #unittesting #csharp
MSTest 3.4 is here with WinUI support and new analyzers!
#visualstudio #unittesting #mstest #winui #windowsdev #dotnet #windowsappsdk #Testing
https://devblogs.microsoft.com/dotnet/introducing-mstest-34/
Unit Testing with Semantic Kernel.
#ai #semantickernel #dotnet #unittesting #copilot
https://devblogs.microsoft.com/semantic-kernel/unit-testing-with-semantic-kernel/
Generate Unit Tests Using AI Assistant by Rachel Appel.
#unittesting #ai #jetbrainsrider #resharper #visualstudio #dotnet #rider #csharp
https://blog.jetbrains.com/dotnet/2024/03/13/generate-unit-tests-using-ai/
Code coverage features in Visual Studio Enterprise.
#visualstudio #dotnet #codecoverage #unittesting #testing #productivity
https://devblogs.microsoft.com/visualstudio/code-coverage-features-in-visual-studio-enterprise/