标签:import float war submit trigger each creating coding module
课程:《程序设计与数据结构》
班级: 1723
姓名: 蒋子行
学号: 20172317
实验教师: 王志强
实验日期: 2018年4月22日
必修/选修: 必修
Master the basic of unit testing and TDD(Test-driven development)
Understand and master 3 vital elements of object-oriented programming:encapsulation, inheritence, polymorphism
Learn the basis of UML modeling
Acquainted with SOLID principles(SRP, OCP, LSP, ISP, DIP)
Acknowlegde the design pattern
Complete experiment 1-5 from mosoteach
StringBuffer
with TDD methodScreenshots of the result(there was some flaws in the original screenshot, the screenshots here are the original screenshot with error and the screenshot of correct output)
As you can see in the first screenshot, class Double is supposed to print a float, however an integer replaced it.This is because variable value
is set to be an int
rather than a double
Solutions of problem 1:Yep, this is it, another bullshit experiment, this is really crazy.This time there are thousands of new concepts and things like that, so I have to find informations about these new things.
Now the first one is JUnit. At first I thought it might be some kind of third party plugin. Well, actually it is ok to say so, but it is a unit testing framework for Java. According to the internet, JUnit plays an important role in the development of test-driven development. By utilizing JUnit, we can write test code, which can greatly improve our coding efficiency.(Though I don‘t really think so)
Well.....so, unit testing? The heck is that?According to the internet: "in computer programming, unit testing is a software testing method by which individual units of source code, sets of one or more computer program modules together with associated control data, usage procedures, and operating procedures, are tested to determine whether they are fit for use." Lets explain this in a intuitive way: imagine a factory that assembles tv, each time before a tv is made, it‘s component would be tested, and that process of testing is the so-called "unit-testing".
Annnd, "test-driven development", which is also known as TDD, is our next object. Test-driven development (TDD) is a software development process that relies on the repetition of a very short development cycle: requirements are turned into very specific test cases, then the software is improved to pass the new tests, only. This is opposed to software development that allows software to be added that is not proven to meet requirements.
Solutions of problem 2:SOLID is an acronym for five design principles.The five principles are:SRP(single responsibility principle), OCP(open/closed principle), LSP(Liskov substitution principle), ISP(interface segregation principle), DIP(dependency inversion principle).
As if life isn‘t suck already, we have to complete all these nonsense in IDEA? NO, it could be worse, that could be worse.
I don‘t think I learned anything from this experiment, I just do what they told me to do. What a waste of time....
Luckily, it is not a completely meaningless experience. It triggered my thinking on the nature of software development. Here is a question: What can you really do? Are you creating code, or you‘re just writing code. Although I just hate these stuff, they play a vital rule in the process of software design. I am not good at all of these, but my rusty brain can still learn a thing or two, it‘s won‘t cause any loss anyway.
20172317 2017-2018-2 《程序设计与数据结构》实验二报告
标签:import float war submit trigger each creating coding module
原文地址:https://www.cnblogs.com/Chiang-B/p/8965622.html