Personal third job: Pair Programming

Github repository Fork warehouse address: https://github.com/zio-1/PairProgramming.git

Operational requirements link: https: //edu.cnblogs.com/campus/xnsy/GeographicInformationScience/homework/8658

PSP2.1 Personal Software Process Stages Estimated time consuming (minutes)
Planning plan 30
Estimate Estimate how much time this task requires 20
Development Develop 300
Analysis Needs analysis (including learning new technologies) 70
Design Spec Generate design documents 20
Design Review Design review (and colleagues reviewed the design documents) 10
Coding Standard Code specifications (development of appropriate norms for the current development) 20
Design Specific design 50
Coding Specific coding 300
Code Review Code Review 60
Test Test (self-test, modify the code, submit modifications) 200
Reporting report 100
Test Report testing report 60
Size Measurement Computing workload 10
Postmortem & Process Improvement Plan Later summarized, and process improvement plan 30
  total 1110

A calculating module interface design and implementation

1, Form Designer

The project consists of a database and C # language composed to achieve the roll call work for students through student database programming and random roll call, and added a roll call is not repeated and display the number of students. Form by the student information form, naming system, loading progress bar and the number of strips of students.

2, code design

Encoding rules are:

File Name (File Name): The name of this file;

PasalCasing: first word identifier capitalization;

camelCasing: lowercase letters of the first word identifier.

Different namespaces classes in the same project, named to avoid duplication. Avoid conflicts and confusion when references;

Above it is embodied in the design of the code, and find their own mistakes, but due to the change of time may be less than the strong, so some may still be slightly naming problem.

Second, the code review

Code specification: C # written specification

discuss together:

 

 

My roommate and viewing from in completing the project division of labor, each completed part of the problem or not, but in the unit test, we think the possibility of testing, because in fact this procedure can return a value test is part of the direct less, so we know how to do, and we let into the interface in the process of modifying the interface looks more beautiful some of the online access in accordance with the method and asked the way.

Third, unit testing

using System;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using DaoLayer;

namespace 单元测试
{
  [TestClass]
  public class UnitTest1
  {
      [TestMethod]
      public void TestMethod1()
      {
          int num = new DaoLayer.StudentDAO().getStudentRecordsNums();
          Assert.Equals(num,84);
      }
  }
}

Fourth, the code shows

using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

using DaoLayer;
using Entity;
using System.Threading;

namespace WinformControlUse
{
  public partial class FrmStudent : Form
  {
      List<Student> stuList=new List<Student>();

      public FrmStudent()
      {
          InitializeComponent();
      }

      void iniControl()
      {
          btnStart.Visible = false;
          btnStop.Visible = false;
          btnLoadStu.Enabled = true;            
      }

      void setControlVisible()
      {
          btnStart.Visible = true;
          btnStop.Visible = true;
          btnLoadStu.Visible = false;          
      }

      private void btnLoadStu_Click(object sender, EventArgs e)
      {          

          //获取学生数据源
          StudentDAO stuDao = new StudentDAO();
          stuList=stuDao.getAllStudents();

          //进度条设置
          int stuCounts = stuList.Count;//及时学生人数
          progressName.Maximum = stuCounts;
       

          //构造数据源
          DataTable dt = new DataTable();          
          dt.Columns.Add("stuID", Type.GetType("System.String"));
          dt.Columns.Add("stuName", Type.GetType("System.String"));
           
          //数据加载以进度条方式展现
          foreach (Student stu in stuList)
          {
              dt.Rows.Add(stu.Id,stu.Name);
              progressName.Value += 1;//一个学生,进度条加1;
              //Thread.Sleep(500);                
          }            
           
          dgvStuList.DataSource = dt;

          setControlVisible();

          this.stunum.Text = "学生人数:" + stuDao.getStudentRecordsNums();

      }

      private void FrmStudent_Load(object sender, EventArgs e)
      {
          iniControl();
      }

      private void timerCallName_Tick(object sender, EventArgs e)
      {
          Random ra = new Random();
          int i = ra.Next(stuList.Count);
          lblName.Text = stuList[i].Name;
      }

      private void btnStart_Click(object sender, EventArgs e)
      {
          timerCallName.Start();
      }

      private void btnStop_Click(object sender, EventArgs e)
      {
          timerCallName.Stop();
      }

      private void label2_Click(object sender, EventArgs e)
      {

      }

      private void label2_Click_1(object sender, EventArgs e)
      {

      }
  }
}

 

 

 

psp表格

PSP2.1 Personal Software Process Stages 实际耗时(分钟)
Planning 计划 30
Estimate 估计这个任务需要多少时间 20
Development 开发 200
Analysis 需求分析 30
Design Spec 生成设计文档 20
Design Review 设计复审 10
Coding Standard 代码规范 20
Design 具体设计 50
Coding 具体编码 300
Code Review 代码复审 60
Test 测试 100
Reporting 报告 100
Test Report 测试报告 10
Size Measurement 计算工作量 10
Postmortem & Process Improvement Plan 事后总结, 并提出过程改进计划 30
  合计 940

附加功能

记录学生的人数,并且防止重复点名情况的发生,让点名系统不是绝对的随机,更节油效率。

项目总结

在这次项目中知道了许多代码编写方面的知识,对编码规范有了一个初步的了解,因此我也更加了解软件工程这门课了,而且我也发现在项目中团队是很重要的,两个人的确能强很多,不仅仅是分工合作,还有更多的是自己对于项目的理解的表达,这是一个人所体会不到的。困难可能很多,但是我觉得只要一起解决就没什么解决不了的,也不会出现死磕的情况。

 

Guess you like

Origin www.cnblogs.com/doctorlan/p/11613982.html