Re: [extremeprogramming] The principle behind How Test-Driven Development Works
"Guilherme Froes" <[email protected]> Sat, 30 Nov 2019 10:03:02 -0300
| Newsgroups | gmane.comp.programming.extreme-programming |
|---|---|
| Message-ID | <CAFV6TV0r_QOYaMi6-bUchcnhxK+-ciisouN==sE=BaEHoX=Uzg@mail.gmail.com> |
Thank you, Slava! Em sex., 29 de nov. de 2019 às 22:37, Slava Imeshev via Groups.Io <imeshev= [email protected]> escreveu: > Hi Guilherme, > > Guided self study is study of the subject by an engineer where they read > some comfortable number of pages per week, take notes and present to their > manager. > > The goal is to cover gaps in their abilities as software engineers. > There’s days my favorite subjects are unit testing, OOP/OOD and refactoring > for engineers. > > It works because it switches engineers from sleeping through the book to > looking for information actively. > > As for testing untestable, I just start a Zoom or a Skype meeting with a > teammate, refactor the class so that the dependencies are expressed as > interfaces (extract method, extract class, extract interface) and then > write a unit test to cover new logic and changed methods using mocks. The > teammate grabs the keyboard any time they want. > > Regards, > > Slava Imeshev > > > On Nov 29, 2019, at 7:20 PM, Guilherme Froes <[email protected]> > wrote: > > > Hi Slava! > > *These days I just automatically launch a guided self study of refactoring > for any member of the team who doesn’t have it. A fun and highly > educational pair programming exercise is ‘making untestable testable’ when > I take a class that a teammate declared untestable, refactor it and cover > with unit tests under an hour. * > > This guided self study and pair programming exercise sound really > interesting. Do you have something about this that you could share or is it > something you create ad-hoc? > > Thanks! > > -Guilherme Froes > > Em sex., 29 de nov. de 2019 às 01:13, Slava Imeshev via Groups.Io <imeshev= > [email protected]> escreveu: > >> I totally agree. TDD is hard if not impossible without designing to best >> practices. >> >> One design principle that seem to work consistently is Inversion of >> Control (IoC) aka Dependency Injection aka Programming to interfaces >> because one of its natural side effects is enabling use of mocks in unit >> tests. >> >> The second important component is knowledge and use of refactoring when >> dealing with a legacy code base because it enables making code testable. >> These days I just automatically launch a guided self study of refactoring >> for any member of the team who doesn’t have it. A fun and highly >> educational pair programming exercise is ‘making untestable testable’ when >> I take a class that a teammate declared untestable, refactor it and cover >> with unit tests under an hour. God bless Martin Fowler. >> >> Regards, >> >> Slava Imeshev >> >> >> On Nov 29, 2019, at 2:05 AM, Charlie Poole <[email protected]> >> wrote: >> >> Most folks I know who are experts at TDD consider that design is part of >> it. Some have even said "It might be called Test Driven Design." However, >> traditionally, it isn't called that. My personal view is that "Development" >> includes Design, so calling it TestDrivenDevelopment is most appropriate. >> Those who prefer "Design" appear to think that Development simply means >> programming, which is not what the word means for me. A further problem >> with "Test Driven Design" is that many folks still think of design as >> something that happens before development, rather than as part of it. >> >> I've seen that some people use ATDD for testing at the story level, >> others call it TDD. I prefer separate names but they both have design >> elements as part of the "development." >> >> > > -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#160368): https://groups.io/g/extremeprogramming/message/160368 Mute This Topic: https://groups.io/mt/39414677/2417047 Group Owner: [email protected] Unsubscribe: https://groups.io/g/extremeprogramming/leave/4902963/619838065/xyzzy [[email protected]] -=-=-=-=-=-=-=-=-=-=-=-