PairProgramming personal third operation

Pair Photo: before the National Day holiday a few days, I and my partner separated, I eat in Zigong cold to eat rabbit, he returned to Qinghai's home, so we use QQ phone to communicate the specific issues of cooperation development, QQ phone screenshot Partner jobs in the blog.

PSP2.1 Personal Software Process Stages Estimated time consuming (minutes) The actual time-consuming (minutes)
· Planning · Plan 10 10
· Estimate • Estimate how much time this task requires 5 5
Development Develop 60 55
· Analysis · Needs analysis (including learning new technologies) 10 15
· Design Spec Generate design documents 5 10
· Design Review · Design Review (and his colleagues reviewed the design documents) 10 10
· Coding Standard · Code specifications (development of appropriate norms for the current development) 20 15
· Design · Specific design 30 20
· Coding · Specific coding 60 80
· Code Review · Code Review 10 10
· Test · Test (self-test, modify the code, submit modifications) 10 10
Reporting report 30 30
· Test Report · testing report 20 20
· Size Measurement · Computing workload 10 10
· Postmortem & Process Improvement Plan · Hindsight, and propose process improvement plan 10 10
total 315 320

Problem-solving ideas

Implementation process

Code Specification

  • See Partner Wangwan Cheng's blog

Code Description

  1. interface design.
    The first step in doing winform randomly named program is to interface design, we do not intend to use other flowers in the sun Hu something, just to make a clear and concise interface (student's name must be big).
  2. Class design
    we utilize the C # class library of some official, for example System.Windows.Forms, System.IO, and the use System.Threading achieve the student's name when naming random flicker effect. Most of the code function has been derived from the utilization of "wheels" very convenient, it is not required to create a new class; the benefits of the code is very simple, two Click events only 25 lines of code.
  3. Detailed code
public void Read_Click(object sender, EventArgs e)
        {
            OpenFileDialog OFD = new OpenFileDialog();
            OFD.InitialDirectory = Environment.GetFolderPath(Environment.SpecialFolder.Desktop);
            OFD.Filter = "(*.txt)|*.txt";
            if (OFD.ShowDialog() == DialogResult.OK)
            {
                string strNames = OFD.FileName;
                //将文件名添加到 textbox中
                TxtName.Text = strNames;
            }
            StudentName = File.ReadAllLines(TxtName.Text);
            //读取完成txt中的姓名,txt中姓名由换行隔开
        }

  • C # call itself provides OpenFileDialogclass.
  • This is what I do when thinking about how to read the student data, think very often send blog, you need to select a picture from your computer hard drive this process, I think this process, there are a lot of software, and the interface is the same, there should be universal standard, bing went to check how to implement the interface selection winform in the file.
  • InitialDirectoryIs to determine what the default file path when this screen pops up, I chose the system environment of a special folder, desktop, I think it is easy to start selecting from the desktop when you select a file, like this improves the ease of use of the software.
  • OFD.Filter = "(*.txt)|*.txt"Is defining the file type of the file selected student, I chose to use txt files to record the student's name, require the txt file, each student's name per line, easy to read at the same time easy to read function.
  • When the OK button at the point, OFD.Filewill return to the path of the selected file.
  • The program interface while displaying a text box into the file path.
  • Use File.ReadAllLinesthis function to each row names are stored in a string array, stored in memory.
  • Have thought about how to read excel file, excel documented because of the way the name is not clear, so no clue, he chose to give up.
 private void Select_Click(object sender, EventArgs e)
        {
            Random RD = new Random();
            for (int i = 1; i <= 20; i++)
            {
                Student.Text = StudentName[RD.Next(0, StudentName.Length - 1)];
                Application.DoEvents();
                Thread.Sleep(150);
            }

            Student.Text = StudentName[RD.Next(0, StudentName.Length - 1)];
        }//姓名滚动3秒后,显示随机选中的姓名
  • The idea is simple function, the first loop 20 of code execution, perform each array generated from a random sample of a Function name, update to Student.Textthe
  • We found that, in the implementation of Thread.Sleep()a function, the program will not be updated interface, nor can click two bottom, Student.Textthe real-time updates do not show on the page.
  • Through discussion and learning in secondary schools to use the search engine Application.DoEvents()function to refresh our program interface, so the whole process back to normal.
The code itself well to support txt file to support any number of student names, as long as the format to meet each student on a separate line to the program reusability is high, suitable for storing different classes of students in different txt file, with courses read the different classes, very convenient.
The program to meet the subject requirements random roll call.
The failures of the code that for the preparation of unit test no idea, two functions are relatively simple, file input from txt, output to Student.Textfunction directly in the Click event, no return value, twisting strength brains think of how to write unit tests, several rounds of testing, so give up.

Pair Programming

In our process of programming knot found Visual Studio 2019 built-in support for Github, you can easily implement branch management, upload and other operations, but i was still inexperienced, so is still using git command line.

to sum up

  • I think the use Github source code management for large projects, it should be very helpful, you can write Framework by the architect, well-defined interface, to control the various developers need to develop what Function, what kind of parameters accepted , return type. Then divide responsibility work detail, a steel building only to fill the skyscraper.
  • But I also want to say, for very small projects, the role of pair programming is not as big a project as significant, similar to this assignment, the function of such a simple function, I think I have the ability to independently and Partner and can save labor,

Guess you like

Origin www.cnblogs.com/xiaoxiao0331/p/11614690.html