Jfdg meetup第3回 dreamforce12について

27
Dreamforce'12 ののののの Force.com Developer Group JP Meetup #3 讃讃 讃@i_sanuki 2012/10/31
  • date post

    14-Sep-2014
  • Category

    Documents

  • view

    988
  • download

    1

description

 

Transcript of Jfdg meetup第3回 dreamforce12について

Page 1: Jfdg meetup第3回 dreamforce12について

Dreamforce'12 の感想とか

Force.com Developer Group JP Meetup #3

讃岐 行( @i_sanuki )

2012/10/31

Page 2: Jfdg meetup第3回 dreamforce12について

2

自己紹介

讃岐 行Sanuki Ikou ( @i_sanuki )

■ 出身

■ がんばれ

Page 3: Jfdg meetup第3回 dreamforce12について

3

Dreamforce の感想とか

Page 4: Jfdg meetup第3回 dreamforce12について

4

所感①

パン食べ飽きた

Page 5: Jfdg meetup第3回 dreamforce12について

5

所感②

セッションが 1000 個以上Community KeynoteNonprofit and Higher Ed Welcome: Imagining the FutureAppExchange Partner KeynoteSecuring Your Mobile Device and Data While Traveling AbroadUnleash the Force.com User Interface with Skuid (Repeat)Workshop #1: Create an App and DatabaseWorkshop #4: Code Custom App Logic (with Apex)Workshop #7: Go Web (with Site.com)Custom Chatter Development in ApexThe 10-Year Evolution of Developers and Salesforce.com21 Changes That Impacted SEO Forever in 2012Backed Up Your Data Today?Building a Student Recruiting EngineBuilding Desktop & Mobile HTML5 Applications with Sencha and Force.comCommunications Industry Kickoff: Time to Transform or Business as UsualFinancial Services Kickoff: The Social Enterprise in Financial ServicesGamifying Social CollaborationHands-on Training: A Guide to Force.com IDE for Non-DevelopersHands-on Training: Customize Reports & Layouts to Fit Your Business NeedsHands-on Training: Extend Reports w Bucketing Cross-filters & Joined Reports (3)Hands-on Training: The Salesforce-Outlook ConnectionHands-on Training: Visualforce Pages in Disguise for Developers (2.5 hr)High Tech Kickoff: The Social Enterprise from Vision to ValueHow Social Media Companies Became Social EnterprisesIdeaExchange: Under the CoversLeveraging Salesforce to Add Agility, Flexibility and Mobility to Your BusinessManufacturing Industry Kickoff: Building the Social EnterpriseMarketing Cloud: Social Media 101Maximizing Your Premier Success PlanSalesforce Platform: Cloud Confidence-A Virtual Tour of Salesforce Data CentersSalesforce Platform: Understand Force.com in 60 Minutes or LessThe Social Enterprise for Government: Transforming Government for the Social EraThinking Differently About OrgsAlzheimer's Society UK Provides Superior Client Service with SalesforceWorkshop #2: Customize a User InterfaceWorkshop #5: Code A Custom User Interface (with Visualforce)Workshop #8: Go Mobile (with the Mobile SDK)Data Visualization with Web StandardsIntegrating Evernote and Salesforce Using the Mobile SDKREST Best PracticesSalesforce Platfrom: Unlocking the Power of the Citizen DeveloperUnderstanding and Extending the Salesforce.com PlatformConsulting Partner KeynoteDriving Adoption Across the Social EnterpriseICMI: Harness the True Power of Your Call Center with Voice of the Customer DataSalesforce Platform: How Heidrick & Struggles manages Custom Apps and Large DataService Cloud: Gamification in the Contact Center - Motivating Agent Teams

Tracking Constituent Engagement with Groundwire EngageWorkshop #2: Customize a User InterfaceWorkshop #5: Code A Custom User Interface (with Visualforce)Building an Enterprise API From The Ground UpCode Talk #3 - SecurityData for SmartiesData Management Tools You Need to KnowFirst Look at a Newly Announced Salesforce Platform Technology (#1)Five Admin Tips Every Developer Needs To KnowGet Connected with your Local Salesforce Platform Developer User GroupHeroku for Mobile AppsImplement Data Governance Around Packaged Apps in Force.comIntegrating Chatter with Cloud Productivity AppsIntroduction to Force.comJavaScript Patterns and Practices from the Salesforce ExpertsPerformance Monitoring and Testing the Salesforce CloudSales Cloud: Speed Date Our Mobile AppsTeam Development on the Force.com PlatformEfficiency Focused Government in the Social EraK-12 Education Orgs Meet UpQuosal Achievements & Success: Driving Profits Through GamificationSocialize Your Presentation with Chatter and the Salesforce Mobile SDKWorkshop #3: Add App Logic with Clicks, Not CodeWorkshop #6: Integrate Systems (with Force.com APIs)Workshop #7: Go Web (with Site.com)All-channel Experience: Being Relevant to Digital Shoppers in Retail and CPGBuilding Web APIs that ScaleBusiness Travel in the Social EnterpriseChatter: Rockstar Roll-outsCollaboration Across the Ecosystem - One Size Doesn't Fit AllDeliver End User Value Without CodeEnhancing Social CRM with Contact Center TechnologiesEnterprise Gamification KickoffEverything You Want To Know About B2B Online MarketingGetting Started With Workflow & ApprovalsGrowing Your Salesforce PracticeHands-on Training: Automate Opportunity Management with Approval ProcessesHands-on Training: Get Started with Sales Cloud Administration (2.5 hr)Hands-on Training: Introduction to Apex Patterns for DevelopersHands-on Training: Introduction to SOQL Using Workbench

Workshop #1: Create an App and DatabaseWorkshop #4: Code Custom App Logic (with Apex)Workshop #8: Go Mobile (with the Mobile SDK)Reporting for DummiesSales Cloud: Beyond Contests - How Zillow Uses Gamification to Increase SalesSecuring Salesforce Mobile SDK Apps with Good DynamicsService Cloud: Making Ideas Work for You - Best PracticesArts & Culture Orgs Meet-UpHealth, Wellness, and the Internet of Things: Force.com and Consumer DevicesMulti-Org Chatter With Heroku7 Habits of Highly Successful Admins: Now With Even More SuccessA Beginner's Guide to Marketing and Sales MeasurementAn Uncertain But Clear Future: Mobile in Financial ServicesAppExchange: Build Your Small Business with AppsApplication Integration Lessons Learned: Customers Share Their StoriesBringing the Power of Customer Conversations to Service CloudChatter: Bechtel Case Study in Social Enterprise TransformationChatter: Use Cases GaloreExpand Your Practice with ISV Apps from the AppExchangeGovernance: It's Not Just For the Large EnterpriseGreatly Expand Chatter Adoption Utilizing Microsoft OfficeHands-on Training: Get Started with Radian6 (2)Hands-on Training: Get Started with the Non-Profit Starter PackHands-on Training: Measure Campaign Results with Reports and Dashboards (2)How Small Business Keep Up with the Velocity of Customer ServiceInsurance User Group: Driving InnovationIntegrated Cloud: Leveraging the Platform To Drive Team SuccessLet Your Big Data Give You a Competitive Edge - OUTSELL, OUTMARKET, OUTSMARTLeveraging Salesforce to Bring Back Trust, Simplicity, and AccessMarketing Cloud: An Intro to Social AdvertisingMarketing Cloud: Gettting Your Brand Started on FacebookMarketing Cloud: Newsjacking-How to Inject your Ideas into a Breaking News StoryMarketing Cloud: Social Media Makeover - How to Create a Professional ProfileMarketing Cloud: You got your Social in my CRM-Merging Radian6 & salesforce.comMedia Industry Kickoff: Media Currency - From Gutenberg to ZuckerbergPatterns of Integration for Salesforce and IBM CognosSales Cloud: 360 Degrees of Contact BlissSales Cloud: Killer Customizations - How Leading Customers are Driving AdoptionSales Cloud: Streamline Processes without Code – Workflow & Approvals in ActionSales Cloud: Streamlining your Quoting and Ordering ProcessesSalesforce Platform: Force.com Product Strategy And RoadmapService Cloud: Delivering Superior Customer Experience with Web ChatService Cloud: Social Customer Service at Salesforce - An Internal Case StudyMetrics That Matter in Social Business Innovation – a Roadmap to Success.

Page 6: Jfdg meetup第3回 dreamforce12について

6

所感③

フレンドリー

Page 7: Jfdg meetup第3回 dreamforce12について

7

所感④

積極的

Page 8: Jfdg meetup第3回 dreamforce12について

8

所感⑤

Salesforce のイベントに行くと女性にモテる

Page 9: Jfdg meetup第3回 dreamforce12について

9

所感⑥

やっぱ英語できないと

Page 10: Jfdg meetup第3回 dreamforce12について

10

感想とか

• パン食べ飽きた• セッションいっぱい• フレンドリー• 積極的• Salesforce はモテる• 英語って大事

Page 11: Jfdg meetup第3回 dreamforce12について

11

せっかくなのでセッション紹介

Page 12: Jfdg meetup第3回 dreamforce12について

12

Apex Unit Testing in the Real World

Page 13: Jfdg meetup第3回 dreamforce12について

13

ベストプラクティス

• 単一レコードでのテスト• 複数レコードでのテスト• ポジティブな動作に対するテスト• ネガティブな動作に対するテスト• 制限ユーザでのテスト

Page 14: Jfdg meetup第3回 dreamforce12について

14

実際は・・・

• Apex Developer 20,000 人に聞きました 「あなたは何のためにユニットテストを書きますか?」

Page 15: Jfdg meetup第3回 dreamforce12について

15

実際は・・・

• Apex Developer 20,000 人に聞きました 「あなたは何のためにユニットテストを書きますか?」

Page 16: Jfdg meetup第3回 dreamforce12について

16

75% の人が「コードカバレッジ」を目的としている

Page 17: Jfdg meetup第3回 dreamforce12について

17

何のためにユニットテストを書くか

• 機能を満たしているか• 変更の影響を確認• デバッグ時間の削減• 自動化• 安心

⇒ 結果としてコードカバレッジ

Page 18: Jfdg meetup第3回 dreamforce12について

18

Trigger のテストサンプル

Page 19: Jfdg meetup第3回 dreamforce12について

19

Trigger のユニットテスト

public static testmethod void test1bad(){

Lead ld = new Lead(LastName='Testname',Company='Testcompany');

Test.StartTest();insert ld;Test.StopTest();

Lead leadres = [Select ID from Lead where ID = :ld.Id];

//assert}

⇒Bad code

■ テストメソッド

Page 20: Jfdg meetup第3回 dreamforce12について

20

Trigger のユニットテスト

public static List<Lead> initTestLeads(Integer count){

List<Lead> lds = new List<Lead>();for(Integer x = 0; x< count; x++){

lds.add(new Lead(LastName='Testname' + String.ValueOf(x), Company='Testcompany' + String.ValueOf(x)));

}return lds;

}

■ オブジェクトの初期化用メソッド

Page 21: Jfdg meetup第3回 dreamforce12について

21

Trigger のユニットテスト

public static void test2support(Integer batchsize){

List<Lead> lds = initTestLeads(batchsize);Test.StartTest();insert lds;Test.StopTest();

Map<ID, Lead> leadsmap = new Map<ID, Lead>(lds);List<Lead> leadres = [Select ID from Lead where

ID in :leadsmap.keyset()];// asserts

}

■ テストメソッドから呼ばれる実行用

Page 22: Jfdg meetup第3回 dreamforce12について

22

Trigger のユニットテスト

public static testMethod void test2single(){

Test2Support(1);}

public static testMethod void test2bulk(){

Test2Support(200);}

■ 一括処理サイズをパラメータで渡す

Page 23: Jfdg meetup第3回 dreamforce12について

23

一括処理のユニットテスト

public static testMethod void test2single(){

Test2Support(1);}

public static testMethod void test2bulk(){

if(! Boolean.valueOf(System.Label.isRunBulkTest)){Test2Support(200);

}}

■ 処理時間が気になる時は・・

Page 24: Jfdg meetup第3回 dreamforce12について

24

Next Step

もっと知りたい方は・・・

Page 25: Jfdg meetup第3回 dreamforce12について

25

資料とか

• Apex Unit Testing in the Real Worldhttp://www.slideshare.net/developerforce/df121251-bhanot

• Apex コードテストメソッドの概要http://wiki.developerforce.com/page/JP:An_Introduction_to_Apex_Code_Test_Methods

• Apex テストコード作成の落とし穴http://blogjp.sforce.com/2011/07/apex-04b8.html

Page 26: Jfdg meetup第3回 dreamforce12について

26

ありがとうございました

@i_sanuki

Page 27: Jfdg meetup第3回 dreamforce12について

27