Tau Empire Codex 2013 | Army Builder Program
Dark Angels Codex 2013
Chaos Daemons Codex 2013
Chaos Space Marines Codex 2012

Warhammer 40k Forum Tau Online

 

Warhammer 40K Forum

Anyone here know anything about Code Analysis?
Reply
Old 26 May 2009, 18:41   #1 (permalink)
Shas'Ui
 
Join Date: Jan 2008
Location: Ireland
Posts: 698
Default Anyone here know anything about Code Analysis?

I'm hoping to stat an internship in the next few weeks. Part of the internship is that I would look at the application in terms of its usage and performance and writing a report on my findings.

I won't be expected to know how to do this immediately, since there's very little of it on the course, so I'll be given time to learn how do it. But I'd like to have a notion on how to do it on my first day.

Does anyone have any tips/good online books that they could give me?
__________________
Click on these little dudes to get a slightly bigger little dude!




http://www.travian.co.uk/?uc=uk1
RonanB1011 is offline   Reply With Quote
Old 26 May 2009, 23:11   #2 (permalink)
Shas'O
 
Join Date: Aug 2006
Posts: 9,460
Default Re: Anyone here know anything about Code Analysis?

I take it you're looking at the source code? Not the completed application?

Well I assume you can program quite well then. Basically the usage should be apparent from the code and the comments. Then for the analysis and performance, you want to look for inefficiencies and possible bugs. That'll probably require going through important bits of code very closely, and also considering algorithms for different tasks on a larger scale.

Realistically though, if you're working for a company, you also want to include commentary about how easily the code can be maintained and how much more efficient it was to write. These days if it takes a programmer an extra 10 hours to cut out 1 second of computation time, that's a very bad trade off. Much better to write simple and easy to maintain but slow code that saves your programming man-hours than to go for OMG OPTIMIZED.
GeekyGator is offline   Reply With Quote
Old 26 May 2009, 23:31   #3 (permalink)
Ethereal
 
Join Date: Jul 2004
Location: UK
Posts: 12,488
Default Re: Anyone here know anything about Code Analysis?

I expect it will be the completed application (or a beta at least), for an internship. Correct me if I'm wrong.

I'm afraid I have done very little such work, aside from evaluating some Project Management software back in college about 5 years ago, and some basic VB programming before that.

I would suggest finding out what language the program is written in first of all if it is looking at the source code as Geeky suggested. Then try to read up on that.
Otherwise I would imagine company literature will be as far as you need to go.

Good luck with it anyway.
__________________
KJ - Friend, Brother, Ork. Never forget you mate.
Restayvien is offline   Reply With Quote
Old 27 May 2009, 02:53   #4 (permalink)
Shas'Ui
 
Join Date: Dec 2008
Posts: 931
Default Re: Anyone here know anything about Code Analysis?

Quote:
Originally Posted by GeekyGator
I take it you're looking at the source code? Not the completed application?

Well I assume you can program quite well then. Basically the usage should be apparent from the code and the comments. Then for the analysis and performance, you want to look for inefficiencies and possible bugs. That'll probably require going through important bits of code very closely, and also considering algorithms for different tasks on a larger scale.

Realistically though, if you're working for a company, you also want to include commentary about how easily the code can be maintained and how much more efficient it was to write. These days if it takes a programmer an extra 10 hours to cut out 1 second of computation time, that's a very bad trade off. Much better to write simple and easy to maintain but slow code that saves your programming man-hours than to go for OMG OPTIMIZED.
no way a slow code is sitting in my 'bastion' for a long time. And if I catch it mid-stride, it won't even see production.

I'm always for efficiency ala 6sigma.


++++++

@emcitykid
I still don't have an idea what kind of 'internship' work is that ? QA ?
QA has a different set of tools and metrics than SA's or DEV's.
omegatron is offline   Reply With Quote
Old 27 May 2009, 03:25   #5 (permalink)
Shas'O
 
Join Date: Aug 2006
Posts: 9,460
Default Re: Anyone here know anything about Code Analysis?

Oh god, 6sigma :P

In all seriousness though, there isn't necessarily anything wrong with slightly slow code, depending on what your task is.
GeekyGator is offline   Reply With Quote
Old 27 May 2009, 03:35   #6 (permalink)
Shas'O
 
Join Date: Jun 2006
Posts: 6,130
Default Re: Anyone here know anything about Code Analysis?

I am highly skeptical of six sigma. It's become yet another buzzword laden miracle cure. Its practically a routine by now...someone slaps a few common sense guidelines together, gives them a snazzy name, and it gets catchy. Then people start following it like a damn religion. Pretty soon its some corporatized monstrosity creating the problems it was originally meant to fix.

See also: Agile Programming.
__________________
Latest Project: Game Design Forums. Register now to get a low user ID, or reserve a forum for your own project.

My various opinions and tacticas, in article form: Ad clicks always appreciated.

Latest article topic: Video game design

Best free webhost Ive found yet: http://www.ultrawebsitehosting.com/2353.html
Tyndmyr is offline   Reply With Quote
Old 27 May 2009, 08:07   #7 (permalink)
Shas'O
 
Join Date: Apr 2004
Location: Retired back into the depths of the Internets.
Posts: 6,440
Send a message via MSN to mace
Default Re: Anyone here know anything about Code Analysis?

This whole thread sounds like waffles to me. (i.e. never heard of six sigma)

All that has been covered in the university subjects that I've done is looking at the time complexity of relatively simple algorithms and using Big O notation to have a general measure of performance.

In general I'd describe it as the analysis of the logic in a piece of code, looking at the number and position of loops, decisions and basic operations, for a given number n input values. Anyway see http://en.wikipedia.org/wiki/Computa...plexity_theory
__________________
mace is offline   Reply With Quote
Old 27 May 2009, 10:57   #8 (permalink)
Shas'Ui
 
Join Date: Jan 2008
Location: Ireland
Posts: 698
Default Re: Anyone here know anything about Code Analysis?

That wiki article you linked there is good, .Mace. It has a lot of practical ideas. ;D

Thanks to everyone who posted, I reckon I've a few more notions on how to go about this now.
__________________
Click on these little dudes to get a slightly bigger little dude!




http://www.travian.co.uk/?uc=uk1
RonanB1011 is offline   Reply With Quote
Old 27 May 2009, 13:22   #9 (permalink)
Shas'O
 
Join Date: Apr 2004
Location: Retired back into the depths of the Internets.
Posts: 6,440
Send a message via MSN to mace
Default Re: Anyone here know anything about Code Analysis?

Quote:
Originally Posted by TheEmCityKid
That wiki article you linked there is good, .Mace. It has a lot of practical ideas. ;D

Thanks to everyone who posted, I reckon I've a few more notions on how to go about this now.
Heh, I didn't actually learn it in that detail. The stuff I learnt was more along the lines of.. assigning a cost to each operation, and finding a way to count the total number of operations. So for a given input n, you could work out the number of times each lines gets executed for example, and perhaps come up with a formula for it (sometimes split into best-case/worst-case scenarios)

So like:
Quote:
$n= 10; // 1 operation
$i = 0; // 1 operation
while ($i < $n) { // 1 operation - everything in this loop gets repeated $n times
$m = 0; // 1 operation
while ($m < $n) { // 1 operation - everything in this inner loop gets repeated $n times
echo "$m "; // 1 op
$m++; // 1 op
}
echo "\n"; // 1 op
$i++; // 1 op
}
Start of code: 2 operations

Inner loop: 3 operations, that get repeated $n times => 3n

Outer loop 4+(3n) operations, repeated n times (the 3n is from the inner loop) => (4+3n)n

Overall: (4+3n)n + 2 = 3n^2 + 4n + 2
The code above is of order n^2 - which means, if you have say, a small n, like 10, you have 100s of operations. If you had a bigger n, like 100, you have a number of operations in the 10000s. Likewise for 1000, there's millions of operations. As you can probably see, as n gets bigger, the number of operations gets much much bigger.

If you had a program that could process say, 10 input files in 0.1 seconds, but takes 1 minute to process a hundred input files.. and a year to process a thousand input files.. then that isn't very efficient :P

[hr]

Anyway, enough waffling. The sort of performance testing we did was based on various sorting algorithms, we manually timed how long it took for each algorithm to sort n elements. From those tabulated results we could clearly see things like which algorithms were n^2, and which ones were better than that (from just increasing n tenfold, the time taken would increase a hundredfold, quite literally).
__________________
mace is offline   Reply With Quote
Old 27 May 2009, 23:44   #10 (permalink)
Shas'O
 
Join Date: Aug 2006
Posts: 9,460
Default Re: Anyone here know anything about Code Analysis?

Oh true, got to watch out for n[sup]2[/sup] and n[sup]3[/sup] lol.
GeekyGator is offline   Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Code 43. WTF? Jeff Computers, Science and Technology 3 05 Mar 2010 10:55
[uid] BB code Xanzar Tau Online Comments/Suggestions 2 16 Mar 2009 19:34
validation code Artiglio Computers, Science and Technology 2 18 Jun 2005 20:26
Favorite Code compubrains Computers, Science and Technology 4 16 Feb 2005 08:30