The fourth unit summary

The fourth unit and semester summary

-------- UML related

A summary of the architecture design of this unit twice a job

  • The first main support class diagrams query, the outermost layer of the data I use is to build institutions like the forest.
    The exact it is, as the root node classes and interfaces, properties, and methods underlying connection, the lower connection method parameters and return values.
    each node needs to record all information itself. own properties and methods such as, properties and methods from the parent class, itself implements an interface, interface indirectly, directly related to, indirect association, etc.
    Since the input element is out of order so inevitably hierarchical processing, I divided the three elements of the sequence traversal entered
    for the first time to convert all of the elements to the corresponding nodes and storage nodes into the pool
    first scan will build up a tree structure.
    the third perfect all other information, such as related to the associated end should also be counted as their own association, the interface is also regarded as indirectly own interface, inherited property also own properties and so on ...
    then you can be based on this relatively large query data structure, the main difficulties in building this data structure, build queries after the end of a very simple, direct access to the corresponding data structure that is May be
    given below of the operation of FIG class:

1270250-20190624171957981-1691810437.png

  • The second job to increase the query and rule checking three UML state diagram and timing chart.
    Data structures and for the first time very much the same. I think the main difficulty is to check three rules.
    Rule number one. Check the same name. This simple, traversing the need to check the elements can be.
    rule number two. cycle inheritance check. for each category, we find the parent class of cyclic manner, if finally found itself then the emergence of inheritance cycle, or 400 cycles (prevent the parent class cycle appears) or the top end of the parent class does not exist.
    rule III. repeated inheritance. or for each class interface node, starting from a depth of traversal to achieve showing the relationship inheritance and composition, to see if cross paths.
    are given below a class diagram of this job:

1270250-20190624172058129-1790767287.png

1270250-20190624171706264-2003147360.png

1270250-20190624171718394-1530628328.png

二 总结自己在四个单元中架构设计及OO方法理解的演进

  • 第一单元介绍面向对象的基本要素. 继承, 封装, 多态, (组合)...作业则是求导计算器.
    我觉得自己仍然是在面向过程编程, 没有理解到面向对象的思想. 好像是设计了好几个类, 也有继承, 但是事实上实现和面向对象毛关系没有. 倒是熟悉了java库的调用等等.
  • 第二单元介绍了多线程编程. 作业是多电梯调度.
    我在前两次作业中并没有理解多线程, 迷迷糊糊混了两次测试, 第二次之后我看了很多资料, 理解了什么是多线程, 写起代码也很轻松. 第三次虽说是作业难度最大的, 但却是我觉得写起来最轻松的, 强侧也没有bug. 同时也开始理解了第一单元的内容. 虽然有时候诸葛亮的嫌疑, 但我觉得如果有机会再写一次第一单元的话, 我相信我的类结构不会再是一个类, 一个构造方法写到底了...
  • 第三单元介绍了JML. 作业是地铁查询系统.
  • 第四单元介绍了UML. 作业是UML解析器.
    我将第三第四单元放在一起来谈, 因为这两个单元都是属于课程组给出接口我们去实现它.
    有了这些接口指引之后, 个人感觉设计难度降低了一些, 这两次作业难度主要在于架构的选择和设计, 本身算法上没有太多刁难人的地方, 地铁作业中可能需要一些相对高级的图论算法, 但都是可以在网上检索道德.
  • 四单元以来, 深深理解了高院长开学说的话"OO要让你们的编程水平呈现一次爆炸式增长, 与之相匹配的地狱式的教学". 自己的编程能力确实有了长足的进步, 现在拿到一个东西写代码之前都要先想想架构, 不敢一个函数瞎写到底了, 单次开发的代码量也从原先的200行左右, 上升到了千行代码. 总的来说, OO虽然恶心, 但是带来的收获的确是巨大的.

三 总结自己在四个单元中测试理解与实践的演进

  • 我理解和接触到的测试可以分为三种: 样例测试, 对拍器测试, 形式验证, 单元测试.
    样例测试是第一阶段所采用的测试方法, 根据一些简单的样例来看看自己的程序是否大方向上实现了预期的功能.
  • 对拍器测试是第二阶段采用的测试方法, 根据多个人的程序, 或多种语言的程序, 或标程来进行黑盒对比测试, 这种方法在时间足够长, 数据量足够大的情况下, 理论上可以找出任何bug.
  • 上面的对拍器测试已经很优秀了, 但是测试数据不可能总是完备的, 所以需要形式验证的方法, 从逻辑层面构建逻辑网络, 进行合理推理, 从纯理论层面验证其正确性.
  • 有时候数据测试和理论验证都不太好进行的时候, 就需要选择单元测试, 针对某一个方法或模块进行针对性测试, 这样可以更高效地发现错误.

  • 实践.
    自己在这学期尝试这写了一些低效的对拍器, 主要是生成的数据不够好. 大部分都是随机数据和无效数据.
    单元测试是个好东西, 尤其是最后两次作业以接口的形式给出. Junit等就派上了用场.
    理论验证仅仅JML学习的时候利用OpenJML试了一下新鲜.

四 总结自己的课程收获

  • 学会了java语言. 面向对象使用的是一门全新的编程语言, java编程语言, java是一门纯粹面向对象的语言, 不同于C++, 吸收了C++面向对象的优点, 同时摒弃掉了C++中多继承, 指针等繁复, 难以理解的内容. java是一门高效, 容易理解的编程语言.
  • 学会了面向对象的思想. 万事万物皆对象, 并不只是在面向对象这门课中有所体现, 具体到其他课程, 生活中的各个方面, 都有所体现.
  • 对工程化开发有所了解. 每天结束工作时你的程序都要能跑, 在性能出现问题之前不考虑性能问题.
  • 学会了测试方法. 对拍器, 单元测试, 形式验证等.

五 立足于自己的体会给课程提三个具体改进建议

  • JML specification unit, I feel not much use in a domestic environment, can swap out other specifications are described. JML in the country little information, too few application scenarios.
  • The first unit is recommended to speak slowly, many students in the first unit began to accept the idea of ​​object-oriented, does not necessarily turn a corner.
  • Actual code or in the form of a lot of packages, some data are given generation, reference tool or testing (end of a can after the unit).

Reproduced in: https: //www.cnblogs.com/black-watch/p/11075890.html

Guess you like

Origin blog.csdn.net/weixin_34090562/article/details/93796846