2022-07-08-Mini-sprint
這一天是mini-sprint。Sprint的精隨就如同字面上的意思,透過實體會面的方式將問題拋出並且修正,在短時間中加速突破困難,就像衝刺一樣。這一天的內容也涵蓋幾個面向:
Unit testing
Unit testing是用來確保程式的品質。與我原先想像不同之處是,100%的unit testing 覆蓋率並非最為理想,100%意味著及便是無傷小雅的修正也會造成testing不通過,然而這並非我們所預期的。而在modmesh中,pytest是用來跑unit testing的target。
1 | make pytest |
Compiler Explorer
We get to know that some bugs lies in runtime rather than compile time, and that same numbers of line in C may not be same number of lines in assembly code, so we may benefit from understanding assembly code. I’ve pasted one of my code to the left, finding the assembly language to the right is nonsense to me, and I went look up for more information, and learned that assembly code is a layer above machine code, where it replace the 0&1 with English; it is also not cross platform. Comparing C with assembly code, C is easier and more efficient in programming, and the running time of the two is roughly the same, therefore it might not be practical to code assembly code. Yet, I have question upon understanding assembly code, at what extent should I expect myself to learn this in the aspect of practical?
**Reply: **
You do not need to worry about assembly right now, but a programmer needs to know their machines eventually. At the moment your understanding to assembly is sufficient. Just be aware of its existence.
Citcuit
每次執行指令時,在電路端都會有不同的表現。