南邮软件工程(双语)学习指南与复习资料

软件工程复习

  1. 适用对象:南邮计算机学院全部专业,计科为双语教学,其他专业为中文教学可适当参考

  2. 题型:判断题(T/F, 5题,10分),问题分析(5题,30分),理解与沟通(3题,30分),分析设计(2题,30分)

  3. 开卷考试,英文答题

  4. 往年试卷:传送门

  5. 想要文件可私信(收取一定费用)

零、常用英语词汇

  • 多态 Polymorphism

  • 利益相关者 stateholder

  • 版型 stereotype

  • 基于构件的软件工程 Component-Based Software Engineering, CBSE

  • 体系结构原型 Archetype

  • 增量 increment

  • 重构 refactor

  • 原型 Prototyping(旨在快速构建软件系统的一个或多个初步版本,供用户和开发团队评估和反馈。原型的主要目的是在开发早期阶段验证需求、设计和功能,减少项目风险,确保最终产品满足用户需求。)

  • CRC (类-职责-协作者 是一种面向对象的设计工具,用于描述类、它们的职责和它们之间的协作。)

一、软件和软件工程(第一章)

1.软件和硬件的区别(P5-6)
  1. Software is developed or engineered it is not manufactured in the classical sense.

  2. Software doesn’t “wear out” but it does deteriorate.

  3. Although the industry is moving toward component-based construction, most software continues to be custom-built.

  1. 硬件是可替换的(零件统一标准,例如自行车的脚蹬坏了可以直接用一个新的脚蹬替换),软件是需要理解用户需求的基础上产生的。

  2. 软件的要求比较高,不能大规模生产,要根据不同客户的需求进行生产。(用户提出需求,开发者确定需求)

  3. 目前软件的发展方向是组件式发展,即可以修改部分模块。

软件=程序+数据+文档

在这里插入图片描述

软件和硬件失效率的解释:

硬件失效率曲线(左图):

  • 硬件的失效率随着时间的推移表现为一个“浴缸曲线”。
  • 初始阶段的高失效率(称为“婴儿死亡率”),这是由于初期故障较多。
  • 中期失效率较低且稳定。
  • 最后阶段失效率再次升高,表示硬件开始“磨损”并逐渐失效。

软件失效率曲线(右图):

  • 软件的失效率在初始阶段较高,主要由于早期的缺陷和错误。
  • 随着时间推移,失效率下降,但并不会像硬件那样达到一个恒定的低值,而是随着修改和更新(如图中标注的“更改”)可能再次升高。
  • 这种波动的失效率是由于每次修改可能引入新的错误,导致失效率上升,随后再下降到一个较低的水平,但不会完全稳定。
2.软件过程(P10-11)

分为框架活动(the process framework)和普适性活动(umbrella activities)

框架活动:沟通(communication)、计划(planning)、建模(modeling)、构建(construction)部署(deployment),是和产生软件产品直接相关的

普适性活动是管理的,和软件产品生产不直接相关,贯穿于整个项目过程(applied throughout a software project)

Description of the Five Framework Activities (6 points)

  1. Communication: Involves gathering requirements through stakeholder meetings, interviews, and discussions to understand the project goals and constraints.
  2. Planning: Entails defining the project scope, estimating costs, scheduling tasks, and allocating resources to create a project plan.
  3. Modeling: Focuses on creating design models, such as UML diagrams, to represent the system architecture and components.
  4. Construction: Involves the actual coding, testing, and debugging of the software components to build the system.
  5. Deployment: Includes delivering the completed software to users, providing documentation, and training, and ensuring the system operates as intended in its environment.

Adjustments for Different Projects (9 points)

  1. Project Size: Smaller projects may require less formal communication and modeling activities, while larger projects may need detailed planning and comprehensive modeling.
  2. Team Experience: Experienced teams might streamline certain activities, while less experienced teams may need more detailed documentation and reviews.
  3. Project Complexity: Complex projects may require more iterative modeling and testing phases, whereas simpler projects can move more linearly through the phases.
  4. Stakeholder Involvement: Projects with high stakeholder involvement may need more frequent communication and feedback loops.
  5. Risk Management: High-risk projects might require more extensive planning and risk mitigation strategies.
  6. Timeline Constraints: Projects with tight deadlines may need to prioritize key features and possibly adopt agile methodologies for iterative development.
3.软件工程的本质(P12)
  1. Understand the problem (communication and analysis).

  2. Plan a solution (modeling and software design).

  3. Carry out the plan (code generation).

  4. Examine result for accuracy (testing & quality assurance).

理解问题(需求分析)、制定计划(需求建模和软件设计)、执行计划(生产代码)、检查结果(测试准确性)

4.软件工程的设计原则(P14-15)
  • The Reason It All Exists - provide value to users.

  • KISS (Keep It Simple, Stupid!) - design simple as it can be.

  • Maintain the Vision – clear vision is essential.

  • What You Produce, Others Will Consume.

  • Be Open to the Future - do not design yourself into a corner.

  • Plan Ahead for Reuse – reduces cost and increases value.

  • Think! – placing thought before action produce results.

最重要的两条规则:
1.面向未来(Be Open to the Future):体系结构的设计

例如女士养宠物的例子中,目前女士提出的是养猫,但是如果只实现养猫的话,不具有可扩展性,即无法面向未来,所以应该实现宠物的抽象类,这样以后女士提出养狗、鸟等不同宠物时,不用修改太多,这里就是用到了多态的概念

2.提前计划复用(Plan Ahead for Reuse):降低项目成本,提升价值

包括知识复用(分析结果复用,即分析模型)、方法复用(设计结果复用,设计模型)、软件成分复用(代码复用),继承是共性局限性大(共性东西少),结构化关联

5.封装、继承、多态

程序中实现多态(同样的行为调用不同的服务)的方法:

  1. 子类继承父类(子类重写父类的方法,父类的变量指向子类的对象)

  2. 具体类实现接口 (具体类重写接口的方法,用接口类指向具体类的对象)

在这里插入图片描述

Inheritance:

  1. The subclass overrides methods of the superclass.
  2. The superclass reference points to the subclass object.

Implementation:

  1. The concrete class overrides methods of the interface.
  2. The interface reference points to the concrete class object.

动态联编(dynamic binding)和滞后联编(late binding)是多态的概念,表示只有程序运行起来的时候才能真正确定子类对象,如女士养宠物中,宠物是一个抽象类,有猫狗等具体实现类,只有运行调用的时候才能知道是猫还是狗

静态联编(static binding)是重载的概念,编译过程就已经确定,不会涉及抽象类的变量

重载实现:

public class Driver {
   
   
    private String name;
    public Driver(String name) {
   
   
        super();
        this.name = name;
    }
    public String getName() {
   
   
        return name;
    }
    public void setName(String name) {
   
   
        this.name = name;
    }
    public void drive(Car c) {
   
   
        c.go(new Address("东北"));
    }
    public void drive(Car c, Address dest) {
   
   
        c.go(dest);
    }
}

多态实现:

public class Driver {
   
   
    private String name;

    public Driver(String name) {
   
   
        super();
        this.name = name;
    }

    public String getName() {
   
   
        return name;
    }

    public void setName(String name) {
   
   
        this.name = name;
    }

    public void drive(Vihecle v) {
   
   
        v.go(new Address("东北"));
    }

    public void drive(Vihecle v, Address dest) {
   
   
        v.go(dest);
    }
}

public class Address {
   
   
    private String name;

    public Address(String name) {
   
   
        super();
        this.name = name;
    }

    public String getName() {
   
   
        return name;
    }

    public void setName(String name) {
   
   
        this.name = name;
    }
}

public abstract class Vihecle {
   
   
    public abstract void go(Address dest);
}

public class Car extends Vihecle {
   
   
    public void go(Address dest) {
   
   
        System.out.println("一路向北,驾着车,去了" + dest.getName());
    }
}

public class SubClass extends Vihecle {
   
   
    public void go(Address dest) {
   
   
        // 实现略
    }
}

public class Broom extends Vihecle {
   
   
    public void go(Address dest) {
   
   
        System.out.println("一骑扫帚上,笑呵呵,去了" + dest.getName());
    }
}

public class Test 
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值