Test fractal

Bonjour, je m'appelle Dmitry Karlovsky et j'adore piloter toutes sortes de jeux étranges. Attention, après cet entretien, vous pouvez avoir un désir étrange, mais irrésistible, de supprimer tous les tests unitaires et e2e de votre projet, car ils nécessitent beaucoup de ressources, mais donnent peu de bénéfices.





TechLead Conf 2020. , .





  • 25
  • 15






? !





, . , , . , . . , , , .



? !



  • ,


, .



? !





.



? !





D, , — . , .



:



, .





, , , , .



:





, .



:





, .







, .



()



— , . , , .





" " "E2E ".



()



— . .





, " " " ".



()



— . , , .





" ". " ", , — , .





, , , .





, . - .





, , .







, .





. . . , .



:



. , , .



sum( 1 , 2 )

function sum( a , b ) {
    logger.trace( a , b )
    return algebra.apply( '+' , a , b )
}


, .



new Sum( algebra , logger ).exec( 1 , 2 )

class Sum {

    constructor(
        private algebra,
        private logger,
    ) {}

    exec( a , b ) {
        logger.trace( a , b )
        return algebra.apply( '+' , a , b )
    }

}


( ) .



:





B. 10 , 10 . 10 , .





. :





, . , :





, , .



:



, . , .





:



, , . , .





, , , .



:





- . .



:



. , . , . , , , 100. , TestBed.





10 .



:



, ..



  1. ""


, , JIT-. .



:



, - - .





DD , B. , , , , ( ) ( ).



: ?



— , .







, , , . , , , , .





: !



, , , , .





, MAM , , . . , , .



:



, , , .





. — , . — , . .



:



, , , . , , .





, — , , . , .



:



, . ..



const app = new Todomvc({ context })

const title = guid()
const rowsPrev = app.rows()

app.NewTitle().value( title )
app.NewSubmit().click()

assertEqual( app.rows()[0].title() , title )
assertEqual( app.rows().slice(1) , rowsPrev )
assertEqual( app.NewTitle().value() , '' )


, , . , . , , .



, . , , .



:



...



  1. NodeJS


: .



:



..





:



, , ..



  • ,
  • ,




...





, - . , .



. . .





, ..



?
+
+
+*


.





...



  • web-
  • 5
  • 300


.





, .







. , , , .





Kent Beck, TDD, , "" , .



:





, .



:





, . , . .



:





. , . . : , .



:





, , , , , . , .



?







  • 1 — .
  • 2 — - , , . . «» ...
  • 3 — , , , , .
  • 3 — , .
  • 3 — , ?
  • 4 — , . 2 .
  • 4 — , - .
  • 5 — , , .
  • 5 — .



All Articles