CN110442526A - A kind of method of counting of valid code - Google Patents

A kind of method of counting of valid code Download PDF

Info

Publication number
CN110442526A
CN110442526A CN201910750847.4A CN201910750847A CN110442526A CN 110442526 A CN110442526 A CN 110442526A CN 201910750847 A CN201910750847 A CN 201910750847A CN 110442526 A CN110442526 A CN 110442526A
Authority
CN
China
Prior art keywords
code
test
counting
redundancy
valid
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN201910750847.4A
Other languages
Chinese (zh)
Inventor
郭颖诗
甘熹晖
叶文芳
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Hai Wen Technology Co Ltd
Original Assignee
Hai Wen Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Hai Wen Technology Co Ltd filed Critical Hai Wen Technology Co Ltd
Priority to CN201910750847.4A priority Critical patent/CN110442526A/en
Publication of CN110442526A publication Critical patent/CN110442526A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/3604Software analysis for verifying properties of programs
    • G06F11/3608Software analysis for verifying properties of programs using formal methods, e.g. model checking, abstract interpretation

Abstract

The present invention relates to software quality technical fields, more particularly to a kind of method of counting of valid code, including evaluation and test driver and evaluation and test Stub, the code that all submissions are run by driving source, the code line effectively run adds up lines of code automatically, the duplicated code adds up to repeat line number automatically, it is described to add up redundant code line number automatically without operation code, all code lines are as unit of KLOC, to system end of run, it is automatically performed code report of accessment and test, the valid code to have corresponding annotation but annotation itself is not counting line number.The mode that the invention takes code to count, by evaluation and test valid code increment come the quality of lifting system version, to avoid maintenance duplicated code and invalid code redundancy bring non-productive work, code report of accessment and test can be effectively automatically performed, it is easy to operate, automation evaluation and test promotes the efficiency and accuracy rate of software operation, reduces the quality cost and risk of software development team instead of manual inspection.

Description

A kind of method of counting of valid code
Technical field
The present invention relates to software quality technical field more particularly to a kind of method of counting of valid code.
Background technique
Code is exactly the source file that the language supported of programmer's developing instrument writes out, and is one group by character, symbol Or signal element indicates the specific rule system of information with discrete form, the principle of Code Design includes uniquely determining property, mark Standardization and versatility, expandability and stability, convenient for identifying and remember, make every effort to short and small and with uniform format and be easily modified Deng, source code is the branch of code, in some sense for, source code is equivalent to code, and in modern procedures language, source code can Occur with books or tape form, but the most commonly used format is text file, the purpose of this typical format is to compile out Computer program, computer source code final purpose are that Human Readable Text translation is become the executable binary system of computer to refer to It enables, this process is compiling, it by compiler by being completed.
Software is the set of a series of computer datas according to particular order tissue and instruction, and software in general is drawn It is divided into system software, application software and the middleware being interposed between the two, software not just includes can be on computers The computer program of operation, document relevant to these computer programs are generally also considered as a part of software, as software is opened The continuous development of hair, traditional evaluation and test code pattern have gradually shown efficiency and accurate problem, have influenced the operation of software Safety.
Summary of the invention
(1) the technical issues of solving
In view of the deficiencies of the prior art, the present invention provides a kind of method of counting of valid code, has raising efficiency and accurate The advantages of rate, solves the problems, such as that traditional evaluation and test code pattern has gradually shown efficiency and accurate, influences the fortune of software The problem of row safety.
(2) technical solution
To realize above-mentioned technical problem, the present invention provides the method for counting of such a valid code, including evaluation and test driving journey Sequence and evaluation and test Stub, the code that all submissions are run by driving source, the code line effectively run tire out automatically Lines of code is counted, the duplicated code adds up to repeat line number automatically, described to add up redundant code line number, institute automatically without operation code All code lines are stated as unit of KLOC, until system end of run, is automatically performed code report of accessment and test.
Further, the valid code will have corresponding annotation but annotation itself is not counting line number, the format of valid code Null or separator are needed, but capable or separator is not counting line number.
Further, the duplicated code is due to service logic, using generating when identical algorithms etc..
Further, the redundant code includes the redundancy of extra execution and the redundancy of code quantity.
Such as in the function of certain section of program, the sentence of appearance does not have the redundancy of the extra execution to the parameter of return Any influence, but perform again repeatedly, is for extra execution, this redundancy is the consumption to CPU, it should prevent this kind it is superfluous It is remaining, it should to comment out.
The redundancy of the code quantity is mainly annotation or some variables not used too many in code, letter It counts and deposits in a program, this redundancy can allow the readable of code to reduce.
(3) beneficial effect
The present invention provides a kind of method of counting of valid code, have it is following the utility model has the advantages that
The method of counting of the valid code, the mode for taking code to count, by evaluation and test valid code increment come lifting system version This quality can effectively be automatically performed code to avoid maintenance duplicated code and invalid code redundancy bring non-productive work Report of accessment and test, easy to operate, automation evaluation and test promotes software operation efficiency and accuracy rate, reduces soft instead of manual inspection The quality cost and risk of part development teams.
Detailed description of the invention
Fig. 1 is structure of the invention flow chart.
Specific embodiment
Following will be combined with the drawings in the embodiments of the present invention, and technical solution in the embodiment of the present invention carries out clear, complete Site preparation description, it is clear that described embodiments are only a part of the embodiments of the present invention, instead of all the embodiments.It is based on Embodiment in the present invention, it is obtained by those of ordinary skill in the art without making creative efforts every other Embodiment shall fall within the protection scope of the present invention.
Referring to Fig. 1, a kind of method of counting of valid code, including evaluation and test driver and evaluation and test Stub, it is described The code of all submissions is run by driving source, the code line effectively run adds up lines of code automatically, described to repeat generation The automatic accumulative repetition line number of code, described to add up redundant code line number automatically without operation code, all code lines are with KLOC For unit, until system end of run, is automatically performed code report of accessment and test.
The valid code to have corresponding annotation but annotation itself is not counting line number, the format of valid code need null Or separator, but capable or separator is not counting line number.
The duplicated code is due to service logic, using generating when identical algorithms etc..
The redundant code includes the redundancy of extra execution and the redundancy of code quantity.
Such as in the function of certain section of program, the sentence of appearance does not have the redundancy of the extra execution to the parameter of return Any influence, but perform again repeatedly, is for extra execution, this redundancy is the consumption to CPU, it should prevent this kind it is superfluous It is remaining, it should to comment out.
The redundancy of the code quantity is mainly annotation or some variables not used too many in code, letter It counts and deposits in a program, this redundancy can allow the readable of code to reduce.
The method of counting of the valid code, the mode for taking code to count are to be promoted by evaluation and test valid code increment The quality for version of uniting can effectively be automatically performed to avoid maintenance duplicated code and invalid code redundancy bring non-productive work Code report of accessment and test, easy to operate, automation evaluation and test promotes software operation efficiency and accuracy rate instead of manual inspection, reduces The quality cost and risk of software development team.
It should be noted that, in this document, the terms "include", "comprise" or its any other variant are intended to non-row His property includes, so that the process, method, article or equipment for including a series of elements not only includes those elements, and And further include other elements that are not explicitly listed, or further include for this process, method, article or equipment institute it is intrinsic Element.
It although an embodiment of the present invention has been shown and described, for the ordinary skill in the art, can be with A variety of variations, modification, replacement can be carried out to these embodiments without departing from the principles and spirit of the present invention by understanding And modification, the scope of the present invention is defined by the appended.

Claims (4)

1. a kind of method of counting of valid code, it is characterised in that: described logical including evaluation and test driver and evaluation and test Stub The source of overdriving runs the code of all submissions, and the code line effectively run adds up lines of code, the duplicated code automatically Automatic accumulative repetition line number, described to add up redundant code line number automatically without operation code, all code lines are with KLOC Unit, until system end of run, is automatically performed code report of accessment and test.
2. a kind of method of counting of valid code according to claim 1, it is characterised in that: the valid code will have phase Not counting line number, the format of valid code needs null or separator for the annotation answered but annotation itself, but capable or separator not counting Line number.
3. a kind of method of counting of valid code according to claim 1, it is characterised in that: the duplicated code be due to Service logic, using being generated when identical algorithms etc..
4. a kind of method of counting of valid code according to claim 1, it is characterised in that: the redundant code includes more The redundancy of remaining execution and the redundancy of code quantity;
The redundancy of the extra execution is such as in the function of certain section of program, the sentence of appearance, not any to the parameter of return Influence, but perform again repeatedly, be for extra execution, this redundancy is the consumption to CPU, it should prevent this kind of redundancy, answer This is commented out;
The redundancy of the code quantity is mainly annotation or some variables not used too many in code, function and It deposits in a program, this redundancy can allow the readable of code to reduce.
CN201910750847.4A 2019-08-14 2019-08-14 A kind of method of counting of valid code Pending CN110442526A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910750847.4A CN110442526A (en) 2019-08-14 2019-08-14 A kind of method of counting of valid code

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910750847.4A CN110442526A (en) 2019-08-14 2019-08-14 A kind of method of counting of valid code

Publications (1)

Publication Number Publication Date
CN110442526A true CN110442526A (en) 2019-11-12

Family

ID=68435652

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910750847.4A Pending CN110442526A (en) 2019-08-14 2019-08-14 A kind of method of counting of valid code

Country Status (1)

Country Link
CN (1) CN110442526A (en)

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20040071357A1 (en) * 2000-12-21 2004-04-15 Paul Cook Decoding of reed-muller codes
CN101582072A (en) * 2008-05-16 2009-11-18 鸿富锦精密工业(深圳)有限公司 System and method for counting codes
CN108920182A (en) * 2018-06-29 2018-11-30 合肥微商圈信息科技有限公司 A kind of novel source code statistical analysis technique and system

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20040071357A1 (en) * 2000-12-21 2004-04-15 Paul Cook Decoding of reed-muller codes
CN101582072A (en) * 2008-05-16 2009-11-18 鸿富锦精密工业(深圳)有限公司 System and method for counting codes
CN108920182A (en) * 2018-06-29 2018-11-30 合肥微商圈信息科技有限公司 A kind of novel source code statistical analysis technique and system

Similar Documents

Publication Publication Date Title
Jiang et al. Automatically generating commit messages from diffs using neural machine translation
Steidl et al. Quality analysis of source code comments
Wirth The design of a PASCAL compiler
Apel et al. An overview of feature-oriented software development.
Farooq et al. An evaluation framework and comparative analysis of the widely used first programming languages
Schimpf et al. ECLiPSe–from LP to CLP
CN108804136B (en) Configuration item type constraint inference method based on name semantics
Kramer et al. How live coding affects developers' coding behavior
Yu et al. Characterizing the usage, evolution and impact of java annotations in practice
Helminen et al. Recording and analyzing in-browser programming sessions
JP2014199569A (en) Source program analysis system, source program analysis method, and program
CN104915774A (en) SVN log analysis and project management software combination-based method
Spinellis et al. The evolution of C programming practices: a study of the Unix operating system 1973--2015
Febbraro et al. Unit testing in ASPIDE
Wilke et al. UML is still inconsistent! How to improve OCL Constraints in the UML 2.3 Superstructure
Li et al. Exploring the effectiveness of llms in automated logging generation: An empirical study
CN110442526A (en) A kind of method of counting of valid code
Aldabjan et al. How should we measure the relationship between code quality and software sustainability
Amadio et al. Certifying and reasoning on cost annotations of functional programs
CN112860242B (en) Automatic mapping method for interactive data of turbine simulator
Chimiak-Opoka et al. A Feature Model for an IDE4OCL
McDaid et al. Quantifying the Impact on Software Complexity of Composable Inductive Programming using Zoea
Tiwari et al. Reverse engineering tools for simplifying programming environment through flowcharting
Bau Integrating Droplet into Applab—Improving the usability of a blocks-based text editor
Murphy-Hill Improving refactoring with alternate program views

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
RJ01 Rejection of invention patent application after publication
RJ01 Rejection of invention patent application after publication

Application publication date: 20191112