Goodbye Michael Foord.
You will be missed.
- Nice write up by Nicholas Tollervey: https://ntoll.org/article/my-friend-michael/
- 2021 interview with him: https://testandcode.com/episodes/145-for-those-about-to-mock-michael-foord
Goodbye Michael Foord.
You will be missed.
- Nice write up by Nicholas Tollervey: https://ntoll.org/article/my-friend-michael/
- 2021 interview with him: https://testandcode.com/episodes/145-for-those-about-to-mock-michael-foord
UwU, I've just found out about `SystemState` in #Bevy
https://docs.rs/bevy/latest/bevy/ecs/system/struct.SystemState.html
It basically allows you to circumvent (mutable) borrowing issues with `App` and `World` when you have exclusive `World` access.
As it turns out, this is especially useful in #UnitTests.
See next two toots for an example...
1/3
Code in #Rust is so correct that the reason your #unittest fails is solely because of wrong #test data.¯\_(ツ)_/¯
Rust is as close to #magic as you can get as a #SoftwareEngineer.
hell is unit tests that pass locally and fail inexplicably on CI
Wondering why your (unit) test fails?
You might have changed the test data, but have you also considered changing the appropriate flags of your class under test when copying an existing test over!?
(don't ask why I'm telling you this)
@shuttle I consequently use #TDD, where possible.
Yes, sure, #Rust prevents a lot of bugs at compile time already, but not logic bugs.
For example in #CSVDiff we have ~70 unit tests and ~12 integration tests. The only "bug report" we have ever gotten was due to a corrupted CSV file (being mistaken with a bug in diff):
See here (qsv):
https://github.com/jqnatividad/qsv/issues/1258#issuecomment-1712924932
csv-diff:
https://gitlab.com/janriemer/csv-diff
In the future I'd like to add property and mutation testing as well
Writing some more unit tests in #Bevy #BevyEngine for the dragndrop plugin (by cadyn - see below) right now. It is so much fun and I already discovered a small bug (the test is red )!
Going to fix it now.
Hopefully, I'm able to get it to green Let's see...
Test Driven Development sometimes is a huge disappointment to me:
I was writing the test first, and then got really surprised that the new method can’t be called because it’s kinda not implemented. How can that be?!
Oh, I see …
And this is why #UnitTests and #TDD are awesome/necessary (even in #Rust/ #RustLang):
The original requirement:
figure out how many columns the _result_ of diffing two CSVs in #CsvDiff have.
Do you see the error-pattern?
It's
- when we have no diff
&&
- at least one CSV has headers
which makes sense, because I've implemented the feature in the diffing logic, but at that point header information is already lost (in some other thread).
Isn't that beautiful!?
Unit-testing a web service in #Rust - by Julio Merino
Since XCTest does not support async expressions in its assert functions I released SwiftAsyncAsserts Swift package to fill that gap.
Write more readable testing code for your async type interfaces in Swift.
Have you also verified what happens when you call your method twice?
SoftwareDev.assert('no unit tests', INSANITY);
Passed: 1 Failed: 0
It's release day!
We just shipped v2 Core Framework 2.5.0, Analyzers 1.2.0, and Visual Studio adapter 2.5.0. This release includes a bunch of quality of life improvements, bug fixes, and an overhauled assertion library that includes new assertions, new overloads, and much better (and most consistent) assertion failure messages.
Enjoy!
Release notes:
https://xunit.net/releases/v2/2.5.0
https://xunit.net/releases/analyzers/1.2.0
https://xunit.net/releases/visualstudio/2.5.0
Writing a #UnitTest for each significant piece of my #Python code is a pain in the ass. Sometimes it feels like I spend most of my #programming time writing test code instead of the stuff I actually want.
But then I add a feature or optimize something and debugging is as simple as making various tests pass again and I’m glad to have invested all that time in the parallel universe of a well-built test suite.
It’s like wearing an N95 during a pandemic, except for your code instead of your brain.