c# - Can I verify if a class is correctly created? -
i know may stupid question, new in programming world there's lot of stuff don't understand or don't know how do.
i'm starting learn little bit c#, , i'm trying create class, far think i'm good, there's no way 'check' if did well... when create solution in xamarin studio on osx, press cmd+enter , solution compile , you'll see result of code wrote, don't know if there's kind of procedure or kind of tip check if class created ok.
so code compiles, work seems asking.
it sounds looking unit testing. go read on , test-driven development.
for small summary, decide in advance of output of object should be, , write tests check output correct under reasonable inputs. code class against test. finally, test it. , then, every time change code, (to add feature or fix bug), run same unit tests, possibly new additions, , verify still pass.
the quality of tests limiting factor in quality of code, learn how write tests when code unexpected, debug it, , realize else should have tested for.
hope helps.
Comments
Post a Comment