Presentation I did at the Master Course (UFBA/UEFS) about (1) the role of refactoring and (2) usability in the evolution of APIs. Feel free to download it, so you can see the notes (almost everything is in portuguese, sorry about that )
27. …To regard the design refactoring
…To review documentation
…To improve de development tools
“Usability of software tools impacts developer
efficiency”
Steven Clarke
28. The results also suggest the need of new software en-
gineering tools that detect and correct inconsistent
program updates when developers apply refactorings.
Number of bug fixes increases after refactorings while
the time taken to fix bugs decreases after refactorings.
API usability can be a significant barrier for programmers
Scenario-based design / User-centered design
You don’t need expensive usability labs
But time, patience, willing participants, and a framework
with which to understand the results of your analysis.
29. Kim, Miryung, Dongxiang Cai, and Sunghun Kim. "An empirical investigation into the
role of API-level refactorings during software evolution." Software Engineering (ICSE),
2011 33rd International Conference on. IEEE, 2011.
Brian Ellis, Jeffrey Stylos, and Brad Myers. 2007. The Factory Pattern in API Design:
A Usability Evaluation. In Proceedings of the 29th international conference on
Software Engineering (ICSE '07). IEEE Computer Society, Washington, DC, USA, 302-
312. DOI=10.1109/ICSE.2007.85 http://dx.doi.org/10.1109/ICSE.2007.85
Jeffrey Stylos and Steven Clarke. 2007. Usability Implications of Requiring Parameters
in Objects' Constructors. In Proceedings of the 29th international conference on
Software Engineering (ICSE '07). IEEE Computer Society, Washington, DC, USA, 529-
539. DOI=10.1109/ICSE.2007.92 http://dx.doi.org/10.1109/ICSE.2007.9
J. Stylos and S. Clarke, “Usability implications of requir- ing parameters in objects’
constructors,” in Proceedings of the 29th International Conference on Software
Engineering, 2007, pp. 529–539.
Ubo Icons Theme 0.1alpha, http://gnome-
look.org/content/show.php/Ubo+Icons+Theme?content=122078
API, de Application Programming Interface (ou Interface de Programação de Aplicativos) é um conjunto de rotinas e padrões estabelecidos por um software para a utilização das suas funcionalidades por aplicativos que não pretendem envolver-se em detalhes da implementação do software, mas apenas usar seus serviços.[1] De modo geral, a API é composta por uma série de funções acessíveis somente por programação, e que permitem utilizar características do software menos evidentes ao utilizador tradicional.[2]
Que são APIs? conjunto de funções para que um aplicativo execute funcionalidades de um programa Vantagens: Developers can speed up the application development Companies don't have to pay for several different software n hardwares By integrating conferencing functionality into existing applications, companies don't have to train IT staff and employees on how to administer and use new software. The company who releases the API allows its customers to access their conferencing services in new, more efficient ways, increasing brand recognition and customer loyalty.
http://blog.programmableweb.com/2012/04/11/what-kinds-of-apis-do-developers-most-love/ Mapping, social, search, photos, shopping, video, music telephony… Web Developers: Web APIs allow advanced functionality and features to be integrated into the websites that they create. There is also greater customization and flexibility with Web APIs than standard “copy and paste” widgets. End Users: A good Web API can help increase the usefulness of a website and make the site interactive and more enjoyable. API Providers: A well built API that is widely used by the web development community can be a powerful marketing tool because it can: Help build brand loyalty Increase interest in the company’s products and services Increase website traffic Provide useful tools to consumers Convey company messaging.
Não existe só API para web Mas web são as mais famosas Twitter cresceu por isto Tem também em SO Android: várias versões Evolução
Visão rápida da API do android VÁRIOS metodos
Exemplo: API interface
Há várias formas de evoluir Corrigir bug, inserir feature (funcionalidade), modificar arquitetura, refatorar… modificar estrutura interna sem alterar seu comportamento externo Quando fazer? Extract Method, Move Method, Move Fiel, Extract Class… Em API: MÉTODOS
FOCO: MÉTODOS! Evolução APIS: dois lados quem consome quem desenvole
Lado consumidor Twitter restricting terms of use of its API Twitter is ecosystem. killing itself by killing the ecosystem that made Twitter Twitter… Não são neutras, podem ser trusts? Como o Windows fez? TIRAR?
Controlando impacto H1: Após a refatoração, há um aumento a curto prazo do número de correções de bugs . H2: Durante a correção de bugs introduzidos perto do momento da refatoração, o tempo médio de correção tente a diminuir após as refatorações. H3 : Correções e refatoração geralmente aparecem na mesma revisão. Além disto, é mais provável que uma revisão de refatoração seja seguida de correção bugs do que outro tipo de revisão H4: Existem relativamente menos refatorações da API antes de grandes publicações de versão? H4 : Existem mais retaforações e correção de bugs imediatamente antes de um grande lançamento de versão.
Ao modificar assinaturas, fazer refactoring etc. OS MÉTODOS ESTÃO FÁCEIS DE ENTENDER? Como garantir?? Usabilidade é otodo!
Que é usabilidade? User Experience é o todo UX não melhora produtos que sucks We need to create stuff thay want to use too ...just about usability “People often think that [UX design] is a way to make products that suck into products that don't suck by d edicating resources to the product's design,” says Chris Fahey, founding partner and principal of Behavior. Making stuff easy and intuitive is far from our only goal. In order to get people to change their behavior, we need to create stuff they want to use, too. ----- Meeting Notes (10/01/13 17:34) ----- iso
Por isto, várias decis`oes de design são importantísstimas. Exemplo do construtor EXEMPLO: For instance, Ellis et al. observed that the Factory pattern hinders API learning [1], and a study by Stylos et al. observed that method placement — for instance, placing a “send” method on a convenience class such as EmailTransport.send(EmailMessage), instead of hav- ing it on the main-type such as EmailMessage.send() — hinders API learning because convenience methods are difficult to discover when learning to use an API [
Por isto, várias decis`oes de design são importantísstimas. Exemplo do construtor convenience methods are difficult to discover when learning to use an API Demoravam mais apara aprender
Steve Jobs NÃO sabia as coisas do nada; Frase de Henry Ford sobre os cavalos: É PRECISO INTERPRETAR!!; Ouvir usuários é importante, Experiência é um caminho de mão única Info importantes para desenvolvedores ao aprender APIS
Para entender isto, um processo igual a de construção de interface Escolha AS PESsoas certas. Tente pegar pessosas representativas. Gente até paga. Pessoas experiente, inexperientes… Existem personas Atividades Escolher APIS (preferência, código aberto, com larga documentação) Escolha as bem feitas Dá uma tarefa Envolver múltiplas tarefas, pois as tarefas comuns dos usuários sempre envolvem pequenas atividades[2] Ambientes iguqias para todos Insumos: documentação e internet (tem histórico) Coleta dos dados: Camtasia (video e audio); Think-aloud protocol, screen capturevideos e entrevistas (5 minutos)
As questões foram organizadas e agrupadas, umas tiveram mais ocorrências que outras. How do I create an object of a given type without a public constructor? “ the constructor is protected; so how do I create a Graphics2D object?” Cada atividade pode ser divida em várias ações Ações agrupadas Entrevistas; Carolyne
As ações ou sequencias de ações, mostravam as dificuldades Browse (looked throught a list of API elements) Select (select a item from the list) Read (lendo parte de código ou texto d api) Navigate (seguindo das dependências) Search (procurando pelo nome do elemento) Switch (Documention and Web, sempre variando) Use (tentou usar um elemento da wbe ou código da API) Backtrack (volta para um lugar a partir do qual ele tem certeza e tenta outro caminho)
1 (maior) tipos relevantes não acessíveis através do tipo em questão (não acessível através de método público) 2 Utilizar o elemento em dúvida como parte da query de busca na web ajuda ( “java xml processing tutorials” sem esquema não trouxa nada) 3 exceptions 4 Quem é melhor? Quem trabalha com ou sem web? Tempo de minerar coisas da web é relavante. Exemplo: código em outro contexto
Discovering Relevant API Elements not Accessible from the Type a Programmer is Working With
Alguma dúvida disto? Talvez o impacto diminua com o tempo (suposição)