[Dlang Episode 102] unittest 2 of n - Test Techniques (Pure, Whitebox, Blackbox, __ctfe, more)

Published: 17 August 2024
on channel: Mike Shah
280
23

►Full DLang Series Playlist:    • D Language (DLang) Programming  
►Find full courses on: https://courses.mshah.io/
►Join as member to get perks:    / @mikeshah  

►Lesson Description: In this lesson I show you some testing techniques in the D programming language. The unittest block again is a simple feature, but we can combine it with things that we have learned before, like the 'pure' attribute. A good unittest usually does not need state from the outside world, so making a unittest pure is a good idea. After this, I then talk about whitebox and blackbox testing, which informs us of how to write a test based on what knowledge we have of the implementation. Then I talk about using 'assertThrown' to capture if an exception is thrown. Finally, I reiterate that we can catch code that executes at compile time or run-time with assert and static assert (this gives a brief introduction to __ctfe). As always, share your interesting use cases with the community in the discussion below!

►Please like and subscribe to help the channel!
►YouTube Channel:    / mikeshah  
►Join our free community: https://courses.mshah.io/communities/...


Watch video [Dlang Episode 102] unittest 2 of n - Test Techniques (Pure, Whitebox, Blackbox, __ctfe, more) online, duration hours minute second in high quality that is uploaded to the channel Mike Shah 17 August 2024. Share the link to the video on social media so that your subscribers and friends will also watch this video. This video clip has been viewed 280 times and liked it 23 visitors.