Feed aggregator
Is the Microsoft-OpenAI 'Bromance' Beginning to Fray?
Read more of this story at Slashdot.
Europe Automakers Launch Cheaper Electric Cars to Compete With China
Read more of this story at Slashdot.
CodeSOD: Perfect Test Coverage
When SC got hired, the manager said "unit testing is very important to us, and we have 100% test coverage."
Well, that didn't sound terrible, and SC was excited to see what kind of practices they used to keep them at that high coverage.
[Test] public void a_definition() { Assert.True(new TypeExpectations<IndexViewModel>() .DerivesFrom<object>() .IsConcreteClass() .IsSealed() .HasDefaultConstructor() .IsNotDecorated() .Implements<IEntity>() .Result); }This is an example of what all of their tests look like. There are almost no tests of functionality, and instead just long piles of these kinds of type assertions. Which, having type assertions isn't a bad idea, most of these would be caught by the compiler:
- DerviesFrom<object> is a tautology (perhaps this test framework is ensuring it doesn't derive from other classes? but object is the parent of all classes)
- IsConcreteClass would be caught at compile time anywhere someone created an instance
- HasDefaultConstructor would again, be caught if it were used
- Implement<IEntity> would also be caught anywhere you actually tried to use polymorphism.
IsSealed and IsNotDecorated will actually do something, I suppose, though I wonder how much I actually care about that something. It's not wrong to check, but in the absence of actual real unit tests, why do I care?
Because every class had a test like this, and because of the way the test framework worked, when they ran code coverage metrics, they got a 100% score. It wasn't testing any of the code, mind you, but hey, the tests touched all of it.
[Advertisement] Utilize BuildMaster to release your software with confidence, at the pace your business demands. Download today!Cuba's Power Grid Collapses Again. And Then a Hurricane Hit
Read more of this story at Slashdot.
Special VHS Release for 'Alien: Romulus' Announced by 20th Century Studios
Read more of this story at Slashdot.
An Alternative to Rewriting Memory-Unsafe Code in Rust: the 'Safe C++ Extensions' Proposal
Read more of this story at Slashdot.
Microsoft's Honeypots Lure Phishers at Scale - to Spy on Them and Waste Their Time
Read more of this story at Slashdot.
Can We Turn Off AI Tools From Google, Microsoft, Apple, and Meta? Sometimes...
Read more of this story at Slashdot.
How WatchTowr Explored the Complexity of a Vulnerability in a Secure Firewall Appliance
Read more of this story at Slashdot.
How WatchTowr Explored the Complexity of Vulnerability in a Secure Firewall Appliance
Read more of this story at Slashdot.
NASA's Artemis Mission To Moon Unveils New Spacesuit Designed By Prada
Read more of this story at Slashdot.
Internet Archive Users Start Receiving Email From 'Some Random Guy' Criticizing Unpatched Hole
Read more of this story at Slashdot.
Could Geothermal Power Revolutionize US Energy Consumption?
Read more of this story at Slashdot.
'100% Free' GNU Boot Discovers They've Been Shipping Non-Free Code - Again
Read more of this story at Slashdot.
Neal Stephenson Publishes First Book in New Atomic Age Spy Series 'Bomb Light'
Read more of this story at Slashdot.
Electric Motors Are About to Get a Major Upgrade - Thanks to Benjamin Franklin
Read more of this story at Slashdot.
Bill Gates Applauds Open Source Tools for 'Digital Public Infrastructure'
Read more of this story at Slashdot.
What Happens When a California Oil Refinery Shuts Down?
Read more of this story at Slashdot.
Chip Designers Recall the Big AMD-Intel Battle Over x86-64 Support
Read more of this story at Slashdot.
After Second Power Outage, 10 Million Cubans Endure Saturday Afternoon Blackout
Read more of this story at Slashdot.