Computer
T-Mobile, AT&T Oppose Unlocking Rule, Claim Locked Phones Are Good For Users
Read more of this story at Slashdot.
Disney To Name Bob Iger's Successor In Early 2026
Read more of this story at Slashdot.
iFixit's Meta Quest 3S Teardown Reveals a Quest 2 'Hiding Inside'
Read more of this story at Slashdot.
'Blade Runner 2049' Producer Sues Tesla, Warner Bros. Discovery
Read more of this story at Slashdot.
Arkansas May Have Vast Lithium Reserves, Researchers Say
Read more of this story at Slashdot.
Tim Cook Knows Apple Isn't First in AI but Says 'It's About Being the Best'
Read more of this story at Slashdot.
Nicolas Cage Urges Young Actors To Protect Themselves From AI
Read more of this story at Slashdot.
A Calculator's Most Important Button Has Been Removed
Read more of this story at Slashdot.
AI 'Bubble' Will Burst 99% of Players, Says Baidu CEO
Read more of this story at Slashdot.
'Crises at Boeing and Intel Are a National Emergency'
Read more of this story at Slashdot.
Dow Jones and New York Post Sue AI Startup Perplexity, Alleging 'Massive' Copyright Infringement
Read more of this story at Slashdot.
Linus Torvalds Growing Frustrated By Buggy Hardware, Theoretical CPU Attacks
Read more of this story at Slashdot.
52nd Known Mersenne Prime Found
Read more of this story at Slashdot.
Egypt Declared Malaria-Free After Century of Work To Defeat Disease
Read more of this story at Slashdot.
Kurt Vonnegut's Lost Board Game Finally Published
Read more of this story at Slashdot.
Intuit Seeks To Scrub CEO Comments on Tax Lobbying From Tech Podcast
Read more of this story at Slashdot.
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.