[LLVMdev] Google Summer of Code

Vassil Vassilev vvasilev at cern.ch
Wed Mar 11 11:58:26 PDT 2015

On 11/03/15 17:14, Anna Zaks wrote:
>> On Mar 11, 2015, at 2:14 AM, Vassil Vassilev <vvasilev at cern.ch 
>> <mailto:vvasilev at cern.ch>> wrote:
>> On 10/03/15 19:13, Anna Zaks wrote:
>>>> On Mar 10, 2015, at 1:03 AM, Vassil Vassilev <vvasilev at cern.ch 
>>>> <mailto:vvasilev at cern.ch>> wrote:
>>>> On 09/03/15 21:52, Anna Zaks wrote:
>>>>> +Easily, some of the code snippets end up being copied dozens of
>>>>> +times, which leads to worse maintainability, understandability 
>>>>> and logical
>>>>> +design.
>>>> Should be better now.
>>>>> The project description stresses code maintainability and logical 
>>>>> design more than bug finding due to omissions in copy and pasted 
>>>>> code. Reading this made me think of a check that would suggest 
>>>>> people to replace copy and pasted code with a function call or 
>>>>> something like that... Examples do stress the specific bugs that 
>>>>> could be found, which is what I had in mind:
>>>>> +   Copy-paste infrastructure could be used to build other 
>>>>> "goodies". Some
>>>>> +examples and possible applications are:
>>>>> Is this intentional? If not, maybe we could rephrase a bit with 
>>>>> more emphasis on bug finding. I would also make it a requirement 
>>>>> to use the infrastructure for bug detection.
>>>> Well, partially yes, I wanted to have the project description as 
>>>> broad as possible so that interested students to specialized in a 
>>>> direction, in which they are most comfortable. Because IMO the 
>>>> project is bigger than 1 usual GSoC project.
>>>> I rephrased it to make it more focused towards bugs. Could you 
>>>> elaborate on the "I would also make it a requirement to use the 
>>>> infrastructure for bug detection.", please?
>>> I would prefer not to have pure infrastructure, but rather develop 
>>> infrastructure along with uses of it. Bug finding is one such use. 
>>> That would allow to set clear goals for the students and allow for 
>>> better qualification of the infrastructure.
>> I see your point and I agree. I really want the proposal up soon. Can 
>> we discuss that in IRC, I think it would be easier for me? My 
>> nickname is vvassilev.
> I am not going to be online in the next couple of hours. I would just 
> rewrite this a bit to make it clear that we expect some useful 
> features being developed along with the copy and paste detection with 
> bug finding as an example. Writing those features would be part of the 
> project.
> If a student is interested in a feature other than bug finding, I’d 
> expect them to specify what that is when they apply. (As far as I 
> recall, the students also write proposals. I am not sure what is the 
> workflow when they reply to our proposal.)
Maybe Anton knows better. AFAIK the organization proposals give the idea 
of what can be done, later the students and the mentors make a proposal 
and based on that a slot for the student is allocated and a student is 
picked up.
> I think the proposal is generally good. I’d just emphasize feature 
> driven development in the goals.
Thanks, see the 3rd version attached.
> Anna.
>> Many thanks,
>> Vassil
>>> (However, I see your point about making it open to students that are 
>>> interested in using this infrastructure for other projects.)
>>>> BTW, please feel free to submit a patch to the patch (:)), if you 
>>>> think something else requires fixing or better wording.
>>>>> Thanks for driving this!
>>>> Sure, thank you for reviewing!
>>>> Vassil
>>>>> Anna.
>>>>>> On Mar 9, 2015, at 1:54 AM, Vassil Vassilev <vvasilev at cern.ch 
>>>>>> <mailto:vvasilev at cern.ch>> wrote:
>>>>>> Hi Anton,
>>>>>>  (CC-ing the people who might be interested to review)
>>>>>>  I am attaching the patch.
>>>>>> Many thanks,
>>>>>> Vassil
>>>>>> On 04/03/15 23:00, Anton Korobeynikov wrote:
>>>>>>> Please provide a patch to Open Projects list.
>>>>>>> On Wed, Mar 4, 2015 at 8:25 PM, Vassil Vassilev 
>>>>>>> <vvasilev at cern.ch <mailto:vvasilev at cern.ch>> wrote:
>>>>>>>> On 17/02/15 09:47, Anton Korobeynikov wrote:
>>>>>>>>> John,
>>>>>>>>> Yes, I'm taking care about application as usual.
>>>>>>>> I saw the the LLVM mentoring org was accepted. Congrats!
>>>>>>>> Anton, could you tell me what is the procedure of submitting a 
>>>>>>>> proposal for
>>>>>>>> a project (I will be the mentor)?
>>>>>>>> Many thanks,
>>>>>>>> Vassil
>>>>>>>>> On Tue, Feb 17, 2015 at 4:48 AM, Eric Christopher 
>>>>>>>>> <echristo at gmail.com <mailto:echristo at gmail.com>>
>>>>>>>>> wrote:
>>>>>>>>>> I believe Anton was going to do so.
>>>>>>>>>> On Mon, Feb 16, 2015, 5:14 PM John Criswell 
>>>>>>>>>> <jtcriswel at gmail.com <mailto:jtcriswel at gmail.com>> wrote:
>>>>>>>>>>> Dear All,
>>>>>>>>>>> Has someone registered LLVM as an organization for Google 
>>>>>>>>>>> Summer of Code
>>>>>>>>>>> 2015?  I'm interested in mentoring a GSoC student this summer.
>>>>>>>>>>> -- John T.
>>>>>>>>>>> --
>>>>>>>>>>> John Criswell
>>>>>>>>>>> Assistant Professor
>>>>>>>>>>> Department of Computer Science, University of Rochester
>>>>>>>>>>> http://www.cs.rochester.edu/u/criswell
>>>>>>>>>>> _______________________________________________
>>>>>>>>>>> LLVM Developers mailing list
>>>>>>>>>>> LLVMdev at cs.uiuc.eduhttp://llvm.cs.uiuc.edu
>>>>>>>>>>> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
>>>>>> --
>>>>>> --------------------------------------------
>>>>>> Q: Why is this email five sentences or less?
>>>>>> A:http://five.sentenc.es <http://five.sentenc.es/>
>>>>>> <CopyPasteDetectorGSoC15.diff>
>>>> <CopyPasteDetectorGSoC15_v2.diff>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20150311/0225fe02/attachment.html>
-------------- next part --------------
Index: OpenProjects.html
--- OpenProjects.html	(revision 231588)
+++ OpenProjects.html	(working copy)
@@ -4,6 +4,7 @@
   <li><a href="#what">What is this?</a></li>
+  <li><a href="#gsoc2015">Google Summer of Code 2015</a></li>
   <li><a href="#gsoc2014">Google Summer of Code 2014</a></li>
   <li><a href="#subprojects">LLVM Subprojects: Clang and VMKit</a></li>
   <li><a href="#improving">Improving the current system</a>
@@ -64,6 +65,97 @@
 <!-- *********************************************************************** -->
 <div class="www_sectiontitle">
+  <a name="gsoc2015">Google Summer of Code 2015 projects</a>
+<!-- *********************************************************************** -->
+<div class="www_subsubsection">
+  <a name="target-desc">Copy-paste detection</a>
+<div class="www_text">
+<p><b>Description of the project: </b>
+The copy-paste is a common programming practice. Most of the programmers start
+from a code snippet, which already exists in the system and modify it to match
+their needs. Easily, some of the code snippets end up being copied dozens of
+times, which leads to a seamless introduction of new hard-to-find bugs.
+Also, copy-paste usually means worse maintainability, understandability and
+logical design.
+<br />
+The topic is very broad and the project should be developed in a feature-centric
+<a href="http://clang.llvm.org">Clang</a> and <a href="http://clang-analyzer.llvm.org/">
+clang's static analyzer</a> provide all the building blocks to build a generic
+C/C++ copy-paste detecting infrastructure. The infrastructure should be evolved
+alongside with useful features as bug checkers and compiler diagnostics.</p>
+<p><b>Expected results: </b>
+  <ul>
+    <li>Develop a copy-paste detecting infrastructure - it should be a part of
+      the existing tools in LLVM's infrastructure.</li>
+    <li>Develop initial detection of slightly modified code - it should extend
+      the copy-paste infrastructure adding some semantic analysis.</li>
+    <li>Develop copy-paste oriented bug checkers - they should be added to
+      clang's static analyzer (see some examples below).</li>
+    <li>Develop thorough test suite.</li>
+    <li>Prepare a final poster of the work and be ready to present it.</li>
+  </ul>
+<p><b>Confirmed Mentor:</b> Vassil Vassilev</p>
+<p><b>How to contact the mentor:</b> vvasilev at cern.ch or
+   vassil_vassilev at hotmail.com</p>
+<p><b>Desirable skills:</b>
+   Advanced C++, Basic knowledge of Clang/Clang Static Analyzer.</p>
+<p><b>What the student will learn:</b> Static analyzer, Clang, etc</p>
+<p><b>Further information:</b>
+   The developed copy-paste infrastructure could be used to build for building
+more advanced bug checkers. Some examples and possible applications are:
+  <ol>
+    <li><b>Detect issues in the control flow:</b>
+      <pre>
+        if (cond)
+          do_a();
+        else
+          do_a(); // here we could implement warning that both branches are the same
+      </pre>
+      A more realistic example (provided by Nick Lewycky) could be:
+      <pre>
+        #define num_cpus() (1)
+        #define max_omp_threads() (1)
+        int test8(int expr) {
+          if (expr)
+            return num_cpus();
+          else
+           return max_omp_threads();
+        }
+      </pre>
+      The implementation should be extremely efficient and with low false
+      positive rate, in order to end up in clang's mainline. Initial work done
+      by Nick could be found 
+      <a href="https://gist.github.com/vgvassilev/471feedc9de61a9590da">here.</a>
+    </li>
+    <li><b>Detect modified code snippets (example by Marshall Clow):</b><br />
+      Code block #1 is about 50 lines of code, with references to a global
+      variable (global1, global1, global1, global1, global1).
+      <br />
+      Code block #2 is an obviously duplicated and edited block of code, with
+      references to (global2, global2, global2, global1, global2).
+      <br />
+      A diagnostics "Are you sure you don't mean 'global2' here?" would be great.
+    </li>
+    <li><b>An example (provided by Sean McBride) that these copy-pasto-s exist
+      even in LLVM/clang codebase:</b>
+      <a href="http://www.viva64.com/en/b/0108/">here.</a></li>
+  </ol></p>
+<!-- *********************************************************************** -->
+<div class="www_sectiontitle">
   <a name="gsoc2014">Google Summer of Code 2014 projects</a>
 <!-- *********************************************************************** -->

More information about the llvm-dev mailing list