150 likes | 274 Views
A code metric tool for Software Engineering. Teng Li. Software Measurement. Why? Mature technologies Larger scale Pursue better control and management Needs for maintain and refractory. Software Measurement. What?
E N D
Software Measurement Why? • Mature technologies • Larger scale • Pursue better control and management • Needs for maintain and refractory
Software Measurement What? • Measurement is a process to assign numbers for each attribute or factor of an object or an event according to rules. • Key: rules, attributes • We use measurement to get quantified assessment for a software.
Software Metrics • A metric is a measurement function. Software Data Numerical data Metric
Metric for code • Code analysis can reflect potential problems in SW design. • Code quality is related to future maintenance and reuse. • Code metric can help developers to avoid fatal design problem and mitigate risks. E.g. Visual Studio 2008 - Code Metrics Sourceforge - Metrics 1.3.6
Metric for code • Metric Step: • Abstract common flaws in coding, like a data class, useless method or duplicated code fragment. • Define a metric rule, like fetch similarity of two code fragment. • Associate a metric rule with a abstract code characteristic. • Get metric value via computing
Metric for code • Framework Software Choose Model Metric result UI Collected data Factor computing Core computing Data storage Repository Model Template Result
Code Bad Smells • Object-Oriented design • To indicate problematic classes or method • Use metrics to provide evidence • E.g. Data Class God Class God Method Feature Envy
My metric tool • Eclipse based plug-in • Parse code and generate AST(Abstract syntax tree) • Using JDT to get elements in a compile unit • Computing values to indicate potential problematic code(bad smells)
My metric tool • Eclipse based plug-in • Parse code and generate AST(Abstract syntax tree) • Using JDT to get elements in a compile unit • Computing values to indicate potential problematic code(bad smells)
Thanks Questions?