Download mandhan

Survey
yes no Was this document useful for you?
   Thank you for your participation!

* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project

Document related concepts
no text concepts found
Transcript
Codex
By- Ishita Mandhan
What is Codex?
• A knowledge base
• Records common practice in Ruby
• Indexes > 3 million lines of code
• Helps programmers avoid bugs
• Not an explicit debugger
• Notifies user of violation of convention
• Code may be syntactically correct but semantically unusual and errorprone
Features
• Statistical linting
• Identifies code that is unlikely to occur & is probably a bug
• Pattern annotation
• Automatically discovering common programming idioms
• Library generation
• Constructing a utility package
Statistical linting
• Function chaining
• lower_case_name = name.downcase!
• downcase! side-effect: changes variable name & returns itself
• Encounters
•
•
•
downcase! 57 times
var=var.any_mathod >100,000 times
lower_case_name = name.downcase >200 times
• Block Return Value analysis
• new_nums =
nums.map do |x|
xˆ2
puts x
end
• Encounters
•
•
•
map blocks 4297 times
puts statements 5335 times
puts at the last line of map 0 times
Statistical linting
• Function type analysis
• Kinds of arguments being passed to function
• Passing positional arguments in the wrong order
• Variable name analysis
• Avoid Key words
• Loop iterator defined as str type
Pattern Annotation
• Commonly occurring snippets
• Inject {|x,y| x+y}
• “sums all elements in a list”
• User Query system
• Code search
• Auto-complete
• Example discovery
Library Generation
• Indexing and Abstraction
• > 3 million lines of code
• 100 most popular Ruby Github projects
• Normalization of code
• Variable abstraction
•
•
•
•
Function call analysis
Function chaining analysis
Block return value analysis
Identifier analysis
• Pattern finding module
•
•
•
•
Project count
Total count
File count
Function count
Video
• https://www.youtube.com/watch?v=jAIWXbygKuc
Paper
• Emergent, Crowd-scale Programming Practice in the IDE
Ethan Fast, Daniel Steffee, Lucy Wang, Joel Brandt, Michael S.
Bernstein1
Related documents