<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
    <title>Blog  for 3081</title>
    <link rel="alternate" type="text/html" href="http://blog.lib.umn.edu/yang2178/3081/" />
    <link rel="self" type="application/atom+xml" href="http://blog.lib.umn.edu/yang2178/3081/atom.xml" />
    <id>tag:blog.lib.umn.edu,2011-09-20:/yang2178/3081//14433</id>
    <updated>2011-11-13T02:02:10Z</updated>
    <subtitle>This is my blog for 3081</subtitle>
    <generator uri="http://www.sixapart.com/movabletype/">Movable Type Enterprise 4.31-en</generator>

<entry>
    <title>Unit Test</title>
    <link rel="alternate" type="text/html" href="http://blog.lib.umn.edu/yang2178/3081/2011/11/unit-test.html" />
    <id>tag:blog.lib.umn.edu,2011:/yang2178/3081//14433.321725</id>

    <published>2011-11-10T01:50:29Z</published>
    <updated>2011-11-13T02:02:10Z</updated>

    <summary>&quot;Unit testing is the execution of a complete class, routine, or small program that has been written by a single programmer or team of programmers, which is tested in isolation from the more complete system&quot; (Code Complete 2). Before we...</summary>
    <author>
        <name>yang2178</name>
        
    </author>
    
    
    <content type="html" xml:lang="en-us" xml:base="http://blog.lib.umn.edu/yang2178/3081/">
        <![CDATA[<p>"Unit testing is the execution of a complete class, routine, or small program that has<br />
been written by a single programmer or team of programmers, which is tested in<br />
isolation from the more complete system" (Code Complete 2). Before we get into unit<br />
tests, we should know the concept of a unit in a program. A unit is the smallest<br />
testable part of an application. A unit can be a function, procedure or a class in object-<br />
oriented programming. Thus we can say that unit testing is the most basic test in a<br />
program.<br />
Unit testing is very important since it actually helps us save a lot of time in big project<br />
development. I am going to list some reasons why a programmer should always write<br />
unit tests.<br />
Firstly, "unit testing is easy to write" (Code Complete). It doesn't cost you a lot of<br />
time to write unit tests. However, you will find that spending time on unit testing is<br />
worth it, as without unit testing, it is easy to run into unexpected errors in debugging.<br />
Secondly, writing unit tests can help you understand the design of your project. One<br />
of the goals of writing tests is to make our program fail, so we have to think of all<br />
kinds of situations to make it happen. This approach in thinking gives us a good<br />
chance to refresh our understanding of program design.<br />
Thirdly, "unit testing exposes requirements problems as soon as possible" (Code<br />
Complete). Since the goal of testing is to make the program fail, programmers have to<br />
take many different situations into account. Therefore, we have to ask our client if a<br />
situation is possible or not, during this procedure, we may find more requirement<br />
details.<br />
After reading the above reasons, I think that you may agree with me that unit testing<br />
is useful and time-saving. What's more, there are many test frameworks such as<br />
cxxTest. The framework cxxTest makes unit testing easy to write. However, as a<br />
beginner I run into a few troubles. For example, do make sure you include the file that<br />
you want to test in the header. I know this is a stupid mistake, but as a beginner it is a<br />
frequent one. Also, I have some issues with TS_ASSERT_EQUALS problem. When I<br />
finished my code and tried to test my assertion, the terminal showed me an error<br />
message with a bunch of weird numbers. I definitely cannot understand these numbers<br />
and so googled them. Fortunately, I found out that the two parameters in<br />
TS_ASSERT_EQUALS are different types but the same value. More specifically, we<br />
know that NULL is a macro and it actually is integer 0 in C++. Yet<br />
TS_ASSERT_EQUALS requires the two parameters be the same type. To solve this I<br />
defined another constant variable (const char* nul = NULL), and passed it to<br />
TS_ASSERT_EQUALS. Finally, it worked and showed 100% test passed.<br />
All in all, cxxTest framework is very useful and convenient since writing assertions is<br />
only one sentence. However, now I am still a beginner and need to spend more time<br />
practicing how to write good unit tests.<br />
</p>]]>
        
    </content>
</entry>

<entry>
    <title>Subversion</title>
    <link rel="alternate" type="text/html" href="http://blog.lib.umn.edu/yang2178/3081/2011/11/subversion.html" />
    <id>tag:blog.lib.umn.edu,2011:/yang2178/3081//14433.318856</id>

    <published>2011-11-01T14:30:56Z</published>
    <updated>2011-11-01T14:34:00Z</updated>

    <summary>&quot;Version control system, also called source code control system, is a place to store all the various revisions of the stuff you write while developing an application.&quot; (Pragmatic Version Control with CVS) There are a lot of different version control...</summary>
    <author>
        <name>yang2178</name>
        
    </author>
    
    
    <content type="html" xml:lang="en-us" xml:base="http://blog.lib.umn.edu/yang2178/3081/">
        <![CDATA[<p>"Version control system, also called source code control system, is a place to store all the various revisions of the stuff you write while developing an application." (Pragmatic Version Control with CVS) There are a lot of different version control tools, such as CVS. Subversion is one of the version control tools. What's more, it is a high-performance, modern version control system. It aims to fix all the shortcomings of the CVS.</p>

<p>I strongly recommend you use this system in development due to the advantages listed in the following:<br />
1. "It gives the team a project-wide undo button; nothing is final, and mistakes are easily rolled back" (Pragmatic Version Control using Subversion). This is a pretty easily used feature for developers since we do not like to delete our code and go back to the start. What's more, version control system makes it easy to roll back and confidently fix mistakes.<br />
2. "It allows multiple developers to work on the same code base in a controlled manner" (Pragmatic Version Control using Subversion). This is my favorite functionality since I do not need to work with my partner face to face. Once we set down the project plan, we can work on our own parts and commit the code into the repository. What's more, this manner is controlled. You need not worry about conflicts since the system will notify you if any exist.<br />
3. "The version control system keeps a record of the changes made over time" (Pragmatic Version Control using Subversion). Every time you commit new codes into the repository, your partner can use the "diff" command to see what you changed. This is helpful to make sure that your partner understands your changes.<br />
4. "A version control system allows you to support multiple releases of your software at the same time as you continue with the main line of development" (Pragmatic Version Control using Subversion). With this feature, there is no need to stop working before you release.<br />
5. "Version control is a project-wide time machine, allowing you to dial in a date and see exactly what the project looked like on that date" (Pragmatic Version Control using Subversion). The system backs up every version committed with date and version number. Once you find fatal mistakes in the current version, you can easily roll back to the prior version.</p>

<p>In this paragraph, I am going to list some basic terminologies and operations in subversion.<br />
1.	Repository: repository is the place where your team stores your project. <br />
2.	Workspace: workspace is your local directory. You work on the local directory and then commit your code into repository.<br />
3.	Check out: this command is to copy a project in repository into your own workspace. Usually you only do this once, but sometimes if you meet problems with your subversion, this is a good method to solve problems. I will explain this in the third part.<br />
4.	Add: mark the file with tag A. This means that if you commit the changes, this file will be uploaded into repository.<br />
5.	Commit: add your local changes into repository. Only by executing this operation can you add your code into repository.<br />
6.	Update: merge the changes in repository into your workspace. After this operation, you can see the job others did.<br />
7.	Status: this operation can show your files' state, such as A(add).<br />
8.	Diff: when you update your workspace, you can use this command to know the changes your partner did.</p>

<p>If you are a beginner with subversion, you may meet an annoying problem. It looks like "xxx" is not a working copy. This problem is very time-consuming and you have to look it up on many Google pages. Thus I am going to make a summary here: firstly, open your terminal and enter the current directory. Secondly, type "ls -a", this command is to help you see the hidden files in your directory. Now you may see a file named ".svn" Thirdly, remove ".svn" and re-commit your file. Fourthly, if this method does work, do not worry. We have a final card to solve this annoying problem. Copy your file into another directory and delete your workspace. Then do the checkout again. Finally, you just copy the file into the workspace and commit them step-by-step.<br />
</p>]]>
        
    </content>
</entry>

<entry>
    <title>Benefits and challenges in team work</title>
    <link rel="alternate" type="text/html" href="http://blog.lib.umn.edu/yang2178/3081/2011/10/benefits-and-challenges-in-team-work.html" />
    <id>tag:blog.lib.umn.edu,2011:/yang2178/3081//14433.315348</id>

    <published>2011-10-16T05:37:21Z</published>
    <updated>2011-10-16T06:08:23Z</updated>

    <summary> I was really happy when my partner and I finished the first iteration and I realized the benefits of working together. Working together does help us to reduce the burden of programing and saves a lot of time. Furthermore,...</summary>
    <author>
        <name>yang2178</name>
        
    </author>
    
    
    <content type="html" xml:lang="en-us" xml:base="http://blog.lib.umn.edu/yang2178/3081/">
        <![CDATA[<p>    I was really happy when my partner and I finished the first iteration and I realized the benefits of working together. Working together does help us to reduce the burden of programing and saves a lot of time. Furthermore, communication with my partner is very helpful in solving the problems we faced.  Take the lexeme pointer as an example, at the beginning I was not very sure that what the lexeme pointer is going to do in the project, I just guessed it was for printing the content of some key words, when my partner had the same understanding and we explained to each other in our own thoughts, we quickly persuaded ourselves that lexeme is indeed a pointer that is used to print the content of key words. To ensure that the same benefits occur on future iterations, I think we must do the following: firstly, both of us should deeply understand the outline of iteration, since if one of us does not understand the project, communication will not be so efficient.  Moreover, since you have to explain the project to your partner, if my understanding is not correct it may mislead him.  Secondly, each of us should have an overview before we communicate our thoughts. Only in this way can we find out the advantages and disadvantages of our reasoning, and then come up with the proper method to start the project. <br />
    Though working together has benefits listed above, we actually had a few problems in our cooperation. For example, my partner disagreed with me on the variable name. I insisted that we should take undeclared variable name into account, so in my idea, this program needs one dynamic array to store the real variable name, which is used to tell apart undeclared variables and declared ones. However, my partner insisted that this is not lexical errors but syntax thing, and we need not pay attention to this problem in the current iteration. Due to our own stubbornness, we stopped working for that night and emailed the professor.  When we later got the reply from our professor Eric, he said my partner is right and syntax errors are not considered now. Though the disagreement was solved, we wasted time in waiting for an unimportant problem. In fact, we should have skipped the problem temporarily and do the irrelevant parts. Complete stop was not a wise choice. On the future iterations, if we face the same situation, I think we can just skip the problem and emailed TA or professor, this is the right way to solve disagreements.<br />
    The first iteration was kind of easy and we finished it without any obstructions.  However, as the class proceeds, the future iterations will be getting harder and harder and I believe that we can learn more from the project.<br />
</p>]]>
        
    </content>
</entry>

<entry>
    <title>Things I want to learn from this class</title>
    <link rel="alternate" type="text/html" href="http://blog.lib.umn.edu/yang2178/3081/2011/09/things-i-want-to-learn-from-this-class.html" />
    <id>tag:blog.lib.umn.edu,2011:/yang2178/3081//14433.309939</id>

    <published>2011-09-25T13:30:01Z</published>
    <updated>2011-09-29T16:23:55Z</updated>

    <summary> I have to say this is a different class, it is very different since we need to write blog o(╯□╰)o(this symbol means I am kind of surprise). Ok, I must admit that I am a person who is kind...</summary>
    <author>
        <name>yang2178</name>
        
    </author>
    
    
    <content type="html" xml:lang="en-us" xml:base="http://blog.lib.umn.edu/yang2178/3081/">
        <![CDATA[<p><br />
  I have to say this is a different class, it is very different since we need to write blog o(╯□╰)o(this symbol means I am kind of surprise). Ok, I must admit that I am a person who is kind of lazy; I do not like creating news either in Facebook or in twitter or in Chinese social network, yeah you are right! I am in the ninety-five percent people who only accept news from others in social networks; sometimes experts call us zombie for a social network.<br />
  Let's get down to business now.<br />
  Due to the big project, it is the first time for me to use version tools system. So this tool is completely new to me. I did hear something like subversion before, such as git. However my knowledge about version control system only stops as a beginner. I know we can share one repository to work together and you can upload new edition to share with your partner, yet these are all basic things, but no details at all. Last Friday's lab was useful for me since I met problems, such as " " is not a working copy which costed me more than 2 hours to fix. We know that software development in business actually is so huge that no one could fight by themselves. Thus we have to use this kind of tool to help us work together well and it is very important for me to be familiar with version control system. So I think this is a big step to help us know more real working context and I do expect to improve myself.<br />
  Another thing I really expect is to design a useful class hierarchy. The reason why I am so interested in this topic is that this summer my friends and I did a project and we needed to design the whole thing in this project, not just coding. My friends took this class already and I found out that they have a better understanding than me in how to decide which should be a class. They did explain to me why they made that decision, but I still want to know more details, such as principles and tradeoff. Therefore, when I read the objectives in the syllabus, I was happy to see this in our plan.<br />
  The next thing we are required to talk is what you feel you know well <br />
》_《!!!..(also means I am kind of surprise).I have to say if you really want me to pick one, maybe writing effective comments is a good choice. I read the comment principle before and know which style people prefer. However, I still cannot promise you that you can understand my Chinese style comments very well, you would feel wierd when reading my comments......<br />
  <br />
</p>]]>
        
    </content>
</entry>

</feed>
