Fantastic C++ Bugs and How to Test Them - Robert Leahy - C++ on Sea 2024

preview_player
Показать описание
---

Fantastic C++ Bugs and How to Test Them - Robert Leahy - C++ on Sea 2024
---

Software engineers universally admit that their code is broken. Bugs don’t seem like single differentiated events but rather individual snowflakes in a constant avalanche. Perhaps we should crystallize this into a principle: Code is broken unless it’s proven working.

This principle of course raises the question of how we should prove code works. Tests are the seemingly-obvious answer but given C++’s low level nature we often see proper testing neglected because it would be difficult or it is said to be impossible. However principles are stronger than suggestions: If code is broken until it’s proven working we need to write tests regardless of how difficult it is.

This talk will take the audience on a tour of several real world C++ bugs, the test code written to prove they were addressed, and the structure of the surrounding code which enabled and supported said tests. Unit testing will be shown not to be a luxury to be afforded, but a necessity which cannot be dispensed with.
---

---

Robert Leahy

Robert is a graduate of the University of Victoria where he specialized in graphics, gaming, and digital geometry processing. After spending 4.5 years in full stack web development he pivoted to financial infrastructure in early 2016 and now works on next generation market data storage and retrieval mechanisms. In 2019 he became involved in the ISO C++ committee with a particular focus on library evolution.
---

C++ on Sea is the international C++ conference taking place by the sea, in the UK. Our venue is in Folkestone, Kent, near the entrance to the channel tunnel with stunning views across the English Channel.
Video Sponsors:
---

---

#cpp #cplusplus #cpptutorial #cppprogramming #cpponsea
Рекомендации по теме
Комментарии
Автор

I really would like to Unit-test some of my code but it really is not possible right now to do so:
The whole thing is one tightly coupled mess where there is no clear cut between the GUI and the database.... There are global singletons with caches, hardcoded directories, DB-accesses etc. And while i voiced my concern about the lack of Unit-tests, tests in general, test-ability or any coherent concept (most people that created the basic framework are no longer around, nobody knows how it works and there is no documentation) - release-dates and deadlines where pushed and even for new features it was actively decided that we are NOT to implement any unittets now cause making the software testable would take too much time.

Of course now face crunchtime to fix the many bugs that have accumulated over the years... and higher up it was still decided to keep working the same way as had been done the past 20 years. And a slow and painful way to sneak in small refactorings and tests along the way.

ABaumstumpf