Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. The Lounge
  3. Code Testing

Code Testing

Scheduled Pinned Locked Moved The Lounge
testingbeta-testingtutorialquestioncode-review
14 Posts 7 Posters 1 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • B Offline
    B Offline
    BrockVnm
    wrote on last edited by
    #1

    Hey everyone, I was recently told that my code will be submitted for code review. I have been developing for about 7 months and my boss has been happy with my work so far so he wants to have my code reviewed by some of the sr guys. I was told to look at extreme programming and also told to write test classes for my code. Is anyone familiar with this and could anyone give me some guidance (if possible) on how to prepare for this? I was wondering if anyone tested there code with test classes and used extreme programming. I am not totally sure what extreme programming is either. So I am looking for some advice on how to prepare for this or on what to do to learn how to write test classes for my code....thanks everyone! :-D


    There are 10 kinds of people in this world. Those who understand binary and those who don't. We shouldn't assume something's debugged just because everyone in the whole world has access to the source code.

    C P P A M 5 Replies Last reply
    0
    • B BrockVnm

      Hey everyone, I was recently told that my code will be submitted for code review. I have been developing for about 7 months and my boss has been happy with my work so far so he wants to have my code reviewed by some of the sr guys. I was told to look at extreme programming and also told to write test classes for my code. Is anyone familiar with this and could anyone give me some guidance (if possible) on how to prepare for this? I was wondering if anyone tested there code with test classes and used extreme programming. I am not totally sure what extreme programming is either. So I am looking for some advice on how to prepare for this or on what to do to learn how to write test classes for my code....thanks everyone! :-D


      There are 10 kinds of people in this world. Those who understand binary and those who don't. We shouldn't assume something's debugged just because everyone in the whole world has access to the source code.

      C Offline
      C Offline
      Chris Meech
      wrote on last edited by
      #2

      For the code review, I'd recommend wearing a flak jacket. That'll reduce the scarring. ;) What test classes and/or extreme programming have to do with a code review, I don't know. A good code review should consist of a review of a printed code listing, where you would be required to answer questions about why you did things a particular way. It should also be used to ensure that coding standards, if they exist in your organisation, are also met. A copy of the spec that you used to generate the code is also essential. Good Luck! :) Chris Meech I am Canadian. [heard in a local bar] Gently arching his fishing rod back he moves the tip forward in a gentle arch releasing the line.... kersplunk [Doug Goulden] Nice sig! [Tim Deveaux on Matt Newman's sig with a quote from me]

      M 1 Reply Last reply
      0
      • B BrockVnm

        Hey everyone, I was recently told that my code will be submitted for code review. I have been developing for about 7 months and my boss has been happy with my work so far so he wants to have my code reviewed by some of the sr guys. I was told to look at extreme programming and also told to write test classes for my code. Is anyone familiar with this and could anyone give me some guidance (if possible) on how to prepare for this? I was wondering if anyone tested there code with test classes and used extreme programming. I am not totally sure what extreme programming is either. So I am looking for some advice on how to prepare for this or on what to do to learn how to write test classes for my code....thanks everyone! :-D


        There are 10 kinds of people in this world. Those who understand binary and those who don't. We shouldn't assume something's debugged just because everyone in the whole world has access to the source code.

        P Offline
        P Offline
        Paul Ingles
        wrote on last edited by
        #3

        Well, if you're using .NET then you're more than likely being asked to write some testing code using a framework such as NUnit or MbUnit -- allowing you to test your actual implementation works as it should. You may want to read up on black box testing best practices to ensure that your tests adequately test your code. The review will probably therefore be examining not only the resulting implementation that provided some functionality/feature, but also the test that ensures the code is doing what it should (and that it fails when it should fail etc.). Extreme Programming really is more to do with process than anything, and unit testing/test-driven/test-first development is just a part of it. XP encourages the writing of tests before the actual code, effectively it should be test > build > fail > code > test > build .. test > pass. Refactoring is another important part to ensure that the internal code quality is as high as possible -- whether you do that at the end of each pass cycle, or at the beginning of each code cycle is probably not massively important. Just that you identify areas where code could be refactored (known as smelly code) to improve quality -- such as large bits of copy/pasted code that could be extracted into a method etc. -- Paul "Put the key of despair into the lock of apathy. Turn the knob of mediocrity slowly and open the gates of despondency - welcome to a day in the average office." - David Brent, from "The Office" MS Messenger: paul@oobaloo.co.uk Download my PGP public key

        1 Reply Last reply
        0
        • B BrockVnm

          Hey everyone, I was recently told that my code will be submitted for code review. I have been developing for about 7 months and my boss has been happy with my work so far so he wants to have my code reviewed by some of the sr guys. I was told to look at extreme programming and also told to write test classes for my code. Is anyone familiar with this and could anyone give me some guidance (if possible) on how to prepare for this? I was wondering if anyone tested there code with test classes and used extreme programming. I am not totally sure what extreme programming is either. So I am looking for some advice on how to prepare for this or on what to do to learn how to write test classes for my code....thanks everyone! :-D


          There are 10 kinds of people in this world. Those who understand binary and those who don't. We shouldn't assume something's debugged just because everyone in the whole world has access to the source code.

          P Offline
          P Offline
          peterchen
          wrote on last edited by
          #4

          Holy Bazooka - a code review after 7 month? I feel bad for waiting one month with the first code review... Introducing Test Classes after 7 month of happy coding? Pulling Gloves over Feet. This seriously sounds like someone told Management that the old way is dead, long live the new way. "No Extreme Programming? Ha, you`re dead. And old-fashioned, which is worse."

          Code Review

          This strongly depends. if your shop has formal coding standards, you did follow them, and you know the general Do's and Dont's of the language,this should be ok. The idea of a code review is - making sure the newbie hired isn't crap - newbies get into a line with the team regarding all the formal aspects - two way knowledge transfer - how to solve small scale problems elegantly - seniors don't get into an "these newbie rules mean nothing to me" habit They should start early, with the first substantial code written. If there's a high skill/rank difference, the senior needs good people skills and/or code review experience.

          Test Classes

          I find that writing Test Classes is simple, if they were considered during design, and they are written alongside the production code. "Testability" is a good indicator for a good design, but I find it impossible for code that has been designed and written "the old way". (btw. extreme programming emphasiszes writing tests *before* production code. Go figure.)

          prepare for the worst

          I don't want to wake sleeping dogs, but this might get harsh. "some of the sr guys" sounds like recipe for disaster (maybe you can get away by getting them into a fight over their own styles :rolleyes: ) You _might_ get cornered, so have your arguments ready: * Were you given (formal?) Coding Standards * Did you get a (formal) specification? * Why was there not a single code review in the past seven months? * Are test classes part of the specification? * Were Test Classes ever mentioned in the last seven months? * If not - did anyone write any test classes in the last seven month? * If not - where does this change in policy come from, what about training, etc. * read up on agile/extreme programaming, so they can't get you with buzzwords (If it should go down this road, keep it nice. "I think this is a great idea, but doing it now is a bit surprising!") If your shop has no previous experience with the techniques mentioned (XP, code review, test classes, etc.), they should rething their way of introducing it. Code Review should start between

          B 1 Reply Last reply
          0
          • P peterchen

            Holy Bazooka - a code review after 7 month? I feel bad for waiting one month with the first code review... Introducing Test Classes after 7 month of happy coding? Pulling Gloves over Feet. This seriously sounds like someone told Management that the old way is dead, long live the new way. "No Extreme Programming? Ha, you`re dead. And old-fashioned, which is worse."

            Code Review

            This strongly depends. if your shop has formal coding standards, you did follow them, and you know the general Do's and Dont's of the language,this should be ok. The idea of a code review is - making sure the newbie hired isn't crap - newbies get into a line with the team regarding all the formal aspects - two way knowledge transfer - how to solve small scale problems elegantly - seniors don't get into an "these newbie rules mean nothing to me" habit They should start early, with the first substantial code written. If there's a high skill/rank difference, the senior needs good people skills and/or code review experience.

            Test Classes

            I find that writing Test Classes is simple, if they were considered during design, and they are written alongside the production code. "Testability" is a good indicator for a good design, but I find it impossible for code that has been designed and written "the old way". (btw. extreme programming emphasiszes writing tests *before* production code. Go figure.)

            prepare for the worst

            I don't want to wake sleeping dogs, but this might get harsh. "some of the sr guys" sounds like recipe for disaster (maybe you can get away by getting them into a fight over their own styles :rolleyes: ) You _might_ get cornered, so have your arguments ready: * Were you given (formal?) Coding Standards * Did you get a (formal) specification? * Why was there not a single code review in the past seven months? * Are test classes part of the specification? * Were Test Classes ever mentioned in the last seven months? * If not - did anyone write any test classes in the last seven month? * If not - where does this change in policy come from, what about training, etc. * read up on agile/extreme programaming, so they can't get you with buzzwords (If it should go down this road, keep it nice. "I think this is a great idea, but doing it now is a bit surprising!") If your shop has no previous experience with the techniques mentioned (XP, code review, test classes, etc.), they should rething their way of introducing it. Code Review should start between

            B Offline
            B Offline
            BrockVnm
            wrote on last edited by
            #5

            I just finished my first major project. I was kind of just thrown in the mix. I believe the app I am working on is being phased out and they kind of put me on here to see how I would do. (Not sure if that makes sense). The guy who will be doing the code review works for a different group on a different app so not sure how that will be. I honestly do not know why they waited this long to do the code review, I was not told about any formal standards (written or verbal). When they want something done they just say hey add this feature and I figure out the rest. It is a little odd being that I am a Jr developer (this is my first development job and they all know this). This is also the first time I have heard of test classes. No one on my team has written any test classes but other teams do that regularly. They are trying to change some policies and starting to send people to training. I don’t know if this makes a difference in methodology but this isn’t a software shop it’s a finical firm.


            There are 10 kinds of people in this world. Those who understand binary and those who don't. We shouldn't assume something's debugged just because everyone in the whole world has access to the source code.

            P 1 Reply Last reply
            0
            • B BrockVnm

              I just finished my first major project. I was kind of just thrown in the mix. I believe the app I am working on is being phased out and they kind of put me on here to see how I would do. (Not sure if that makes sense). The guy who will be doing the code review works for a different group on a different app so not sure how that will be. I honestly do not know why they waited this long to do the code review, I was not told about any formal standards (written or verbal). When they want something done they just say hey add this feature and I figure out the rest. It is a little odd being that I am a Jr developer (this is my first development job and they all know this). This is also the first time I have heard of test classes. No one on my team has written any test classes but other teams do that regularly. They are trying to change some policies and starting to send people to training. I don’t know if this makes a difference in methodology but this isn’t a software shop it’s a finical firm.


              There are 10 kinds of people in this world. Those who understand binary and those who don't. We shouldn't assume something's debugged just because everyone in the whole world has access to the source code.

              P Offline
              P Offline
              peterchen
              wrote on last edited by
              #6

              Sounds pretty weird - you were working pretty informal, and suddenly should retrofit a different style. Like Someone up the ladder decided that something must be done about this "inefficient software guys", and hired an expensive contractor to "updatize" the process. But heck, maybe the other guy just wants to see if you are fit for his team. Read up bit on the stuff and then ask your boss "innocently" why this change in policy, why the test classes were never mentioned before etc. This[^] is the usual starting point, but I had to work through tons of FUD to get to the core of it. There is also a little article[^] by me that can give you another pov. With the code review - just keep it cool. It depends a lot on the guy. There is nothing you did wrong. Bad coding style? "yes sorry, noone seemed to care". Stupid code? "Yes, yur way seems much better, thanks for the tip." With test classes, I am realy biased, sometimes they work, sometimes they don't. The *core* seems to be to isolate as much as possible into policy classes that have a "leog interface", which can be tested, and build the final software (which seems untestable to me with reasonable effort) from these blocks. A short google turned up this[^] link I am going to read now :) Good luck, and keep us updated, ok?


              I never really know a killer from a savior
              boost your code || Fold With Us! || sighist | doxygen

              B 1 Reply Last reply
              0
              • P peterchen

                Sounds pretty weird - you were working pretty informal, and suddenly should retrofit a different style. Like Someone up the ladder decided that something must be done about this "inefficient software guys", and hired an expensive contractor to "updatize" the process. But heck, maybe the other guy just wants to see if you are fit for his team. Read up bit on the stuff and then ask your boss "innocently" why this change in policy, why the test classes were never mentioned before etc. This[^] is the usual starting point, but I had to work through tons of FUD to get to the core of it. There is also a little article[^] by me that can give you another pov. With the code review - just keep it cool. It depends a lot on the guy. There is nothing you did wrong. Bad coding style? "yes sorry, noone seemed to care". Stupid code? "Yes, yur way seems much better, thanks for the tip." With test classes, I am realy biased, sometimes they work, sometimes they don't. The *core* seems to be to isolate as much as possible into policy classes that have a "leog interface", which can be tested, and build the final software (which seems untestable to me with reasonable effort) from these blocks. A short google turned up this[^] link I am going to read now :) Good luck, and keep us updated, ok?


                I never really know a killer from a savior
                boost your code || Fold With Us! || sighist | doxygen

                B Offline
                B Offline
                BrockVnm
                wrote on last edited by
                #7

                Will do thanks for the tips!! I will begin my reading to try and be prepared.


                There are 10 kinds of people in this world. Those who understand binary and those who don't. We shouldn't assume something's debugged just because everyone in the whole world has access to the source code.

                1 Reply Last reply
                0
                • B BrockVnm

                  Hey everyone, I was recently told that my code will be submitted for code review. I have been developing for about 7 months and my boss has been happy with my work so far so he wants to have my code reviewed by some of the sr guys. I was told to look at extreme programming and also told to write test classes for my code. Is anyone familiar with this and could anyone give me some guidance (if possible) on how to prepare for this? I was wondering if anyone tested there code with test classes and used extreme programming. I am not totally sure what extreme programming is either. So I am looking for some advice on how to prepare for this or on what to do to learn how to write test classes for my code....thanks everyone! :-D


                  There are 10 kinds of people in this world. Those who understand binary and those who don't. We shouldn't assume something's debugged just because everyone in the whole world has access to the source code.

                  A Offline
                  A Offline
                  Allen Anderson
                  wrote on last edited by
                  #8

                  while I'm not sure how much fun your going to have retrofitting tests to the code you've been writing for a while now, I will say this. XP and Agile development are good things. We get so much more done using XP as a team. You really have to drink the coolaid though and go all out with it to get the most out of it.

                  1 Reply Last reply
                  0
                  • C Chris Meech

                    For the code review, I'd recommend wearing a flak jacket. That'll reduce the scarring. ;) What test classes and/or extreme programming have to do with a code review, I don't know. A good code review should consist of a review of a printed code listing, where you would be required to answer questions about why you did things a particular way. It should also be used to ensure that coding standards, if they exist in your organisation, are also met. A copy of the spec that you used to generate the code is also essential. Good Luck! :) Chris Meech I am Canadian. [heard in a local bar] Gently arching his fishing rod back he moves the tip forward in a gentle arch releasing the line.... kersplunk [Doug Goulden] Nice sig! [Tim Deveaux on Matt Newman's sig with a quote from me]

                    M Offline
                    M Offline
                    Marc Clifton
                    wrote on last edited by
                    #9

                    Chris Meech wrote: What test classes and/or extreme programming have to do with a code review, I don't know. Well, the XP people believe that a "code review" means it passes all the unit tests. :rolleyes: (well, maybe not, but that seems to be the general impression that I get). Marc MyXaml Advanced Unit Testing YAPO

                    C 1 Reply Last reply
                    0
                    • B BrockVnm

                      Hey everyone, I was recently told that my code will be submitted for code review. I have been developing for about 7 months and my boss has been happy with my work so far so he wants to have my code reviewed by some of the sr guys. I was told to look at extreme programming and also told to write test classes for my code. Is anyone familiar with this and could anyone give me some guidance (if possible) on how to prepare for this? I was wondering if anyone tested there code with test classes and used extreme programming. I am not totally sure what extreme programming is either. So I am looking for some advice on how to prepare for this or on what to do to learn how to write test classes for my code....thanks everyone! :-D


                      There are 10 kinds of people in this world. Those who understand binary and those who don't. We shouldn't assume something's debugged just because everyone in the whole world has access to the source code.

                      M Offline
                      M Offline
                      Marc Clifton
                      wrote on last edited by
                      #10

                      I've written a bunch of articles on unit testing and co-authored an article on XP, here on CP. That might help to get you started. Marc MyXaml Advanced Unit Testing YAPO

                      B 1 Reply Last reply
                      0
                      • M Marc Clifton

                        I've written a bunch of articles on unit testing and co-authored an article on XP, here on CP. That might help to get you started. Marc MyXaml Advanced Unit Testing YAPO

                        B Offline
                        B Offline
                        BrockVnm
                        wrote on last edited by
                        #11

                        I will look up the article on cp, but do you have links to the other articles you may have written that are not on cp? Thanks!


                        There are 10 kinds of people in this world. Those who understand binary and those who don't. We shouldn't assume something's debugged just because everyone in the whole world has access to the source code.

                        1 Reply Last reply
                        0
                        • M Marc Clifton

                          Chris Meech wrote: What test classes and/or extreme programming have to do with a code review, I don't know. Well, the XP people believe that a "code review" means it passes all the unit tests. :rolleyes: (well, maybe not, but that seems to be the general impression that I get). Marc MyXaml Advanced Unit Testing YAPO

                          C Offline
                          C Offline
                          Christian Graus
                          wrote on last edited by
                          #12

                          Good - XP really IS stupid. Christian I have several lifelong friends that are New Yorkers but I have always gravitated toward the weirdo's. - Richard Stringer

                          M 1 Reply Last reply
                          0
                          • C Christian Graus

                            Good - XP really IS stupid. Christian I have several lifelong friends that are New Yorkers but I have always gravitated toward the weirdo's. - Richard Stringer

                            M Offline
                            M Offline
                            Marc Clifton
                            wrote on last edited by
                            #13

                            Christian Graus wrote: Good - XP really IS stupid. Gads, I think you're taking my place for highly opinionated, to the point, statements. Well, not that others don't do that either, but I always thought I had a special little place here on CP. You're invading my territory! :-D I guess you've gotten tired of pandering to the lower life forms, eh? Marc MyXaml Advanced Unit Testing YAPO

                            C 1 Reply Last reply
                            0
                            • M Marc Clifton

                              Christian Graus wrote: Good - XP really IS stupid. Gads, I think you're taking my place for highly opinionated, to the point, statements. Well, not that others don't do that either, but I always thought I had a special little place here on CP. You're invading my territory! :-D I guess you've gotten tired of pandering to the lower life forms, eh? Marc MyXaml Advanced Unit Testing YAPO

                              C Offline
                              C Offline
                              Christian Graus
                              wrote on last edited by
                              #14

                              *grin* Well, I've had a few bad days in a row, so that always brings out my dark side... Christian I have several lifelong friends that are New Yorkers but I have always gravitated toward the weirdo's. - Richard Stringer

                              1 Reply Last reply
                              0
                              Reply
                              • Reply as topic
                              Log in to reply
                              • Oldest to Newest
                              • Newest to Oldest
                              • Most Votes


                              • Login

                              • Don't have an account? Register

                              • Login or register to search.
                              • First post
                                Last post
                              0
                              • Categories
                              • Recent
                              • Tags
                              • Popular
                              • World
                              • Users
                              • Groups